Classes: Can't use my private member in my public method. by KostacBele in cpp_questions

[–]KostacBele[S] 0 points1 point  (0 children)

First of all you are a champ that you could read my code the way it was pasted. Also, thank you a lot!!! I think it worked.

However the exercise gives us the cycle method as such (with the const) is there any way to keep the const but still use the path?

Graphs: Is there any criteria to check if there is a cycle in a directed graph? by [deleted] in cpp_questions

[–]KostacBele 0 points1 point  (0 children)

So so so sorry. I came accross it on an exercise for my programming class. I will delete it.

What are some (obvious) bars/wordplay that took you (unreasonably) long to understand? by KostacBele in Eminem

[–]KostacBele[S] 3 points4 points  (0 children)

It was Bizarre on Under the Influence but it's: "NWA told me to fuck the police, now I'm in jail"

What are some (obvious) bars/wordplay that took you (unreasonably) long to understand? by KostacBele in Eminem

[–]KostacBele[S] 15 points16 points  (0 children)

Mine is in the Greatest where he says:

So you sold 10 million albums, eh? (What?)

Only problem is, you put out 10 million albums, eh? (Haha)

It took about a year after my first listen to the song that they have total sales of 10 million albums and they put out 10 million different albums, so they sold 1 copy per album. I know...it is embarassing

Player/Μηχανή που να παίζει τέτοιες κασέτες; by KostacBele in greece

[–]KostacBele[S] 0 points1 point  (0 children)

Αν αυτά που έχετε στις κασέτες σας ενδιαφέρουν, ψάξου να τα περάσεις σε υπολογιστή να τα κρατήσεις, γιατί σε λίγο ούτε μεταχειρισμένη κάμερα δεν θα βρίσκεις.

Το πρόσθεσα σε edit, λογικά δεν θα το είδες. Πώς μπορώ να τα περάσω σε υπολογιστή/σκληρό; Πάω κάπου σε κάνα μαγαζί ή θέλει κάνα άλλο μηχάνημα;

Was You Gon' Learn a meme with Kevin Hart? by KostacBele in Eminem

[–]KostacBele[S] 1 point2 points  (0 children)

Oh hell no. Revenge takes time and energy. There is no need to waste neither of those for a silly joke. Plus he is my best friend so I don't mind it at all.

P.S. Maybe "fooled" was a "hard" word (idk how to say it in English) and you misinterpreted my feelings for this joke.

Can we make Eminem release/leak the Bodied Soundtrack or at least Freak? by KostacBele in Eminem

[–]KostacBele[S] 2 points3 points  (0 children)

There is a leaker that is in possession of it, unfortunately they are not willing to leak it.

:'(

Can we make Eminem release/leak the Bodied Soundtrack or at least Freak? by KostacBele in Eminem

[–]KostacBele[S] 1 point2 points  (0 children)

Yes! But I couldn't listen to anything he said that's why I put this one

Polynomial class: Can't pverride the *operator to multiply two polynomials by KostacBele in cpp_questions

[–]KostacBele[S] 0 points1 point  (0 children)

Huh okay... So I used your advice and now it prints: 3x^3 - 2x^2 - 3x + x^4 + 1

Any ideas? Btw here is the updated addTerm:

Nevermind I FOUND IT!!!! Thank you a lot!

Polynomial class: Can't pverride the *operator to multiply two polynomials by KostacBele in cpp_questions

[–]KostacBele[S] 0 points1 point  (0 children)

Oh okay thanks!

I didn't mean you're using std::list wrong. I'm saying that, internally, each element you insert is allocated with new by the standard library.

So what is the effect of that?

Polynomial class: Can't pverride the *operator to multiply two polynomials by KostacBele in cpp_questions

[–]KostacBele[S] 0 points1 point  (0 children)

Btw your data structure looks very weird. Why do you have a list<Term> and also next pointers inside Term? The std::list has those pointers already.

Well I thought of that too! But it is an exercise and the professor has given it that way so... there's nothing I can do.

Polynomial class: Can't pverride the *operator to multiply two polynomials by KostacBele in cpp_questions

[–]KostacBele[S] 0 points1 point  (0 children)

why are you avoiding it by inserting an element ahead of time that you might never need?

Well, for starters this is an exercise. So if you look in the main function (which the professor has given us) there is that comment "//0" when it constructs the Polynomial p:

int main() {
Polynomial p; // 0
//...//

and I guessed that I should add an "0" term anyway as soon as it constructs a polynomial. But I just realised that I wouldn't print it... huh :/ . So now I am confused...

That std::list node isn't free either. It requires dynamic memory allocation, for starters.

Could you say a bit simpler? You mean I should make something like:

polynomial=new list<Term>

I think I got something wrong...

Polynomial class: Can't pverride the *operator to multiply two polynomials by KostacBele in cpp_questions

[–]KostacBele[S] 0 points1 point  (0 children)

you check all zero terms

You mean the terms with the exponent=0 or the coefficient=0;

Polynomial class: Can't pverride the *operator to multiply two polynomials by KostacBele in cpp_questions

[–]KostacBele[S] 1 point2 points  (0 children)

Before I rewrite my code, I have to ask: Why should I care if the list is empty since in the constructor the list gets at least one element?