Yeah, I know that's what I need to do now but I don't know where to start. I have read through these forums on the subject as well. Thanks for the links though. Is it possible if someone could give me an example within my code and maybe I can go from there?
Thank you very much. So, when you supplied those constructors and operators, now would my next step would be to formulate a code on how to add/subtract/multiply/as well as - (unary) the complex numbers?
Yes, it is like that. You migt want to provide default constrctor (creating 0, 0 number). Also provide operators @ and @= in pairs, so people will not be suprised by some unexpected behavior.
1) operator== should return bool, so sigature would be booloperator==(const Complex&, const Complex&)
2) It just calling itself now. Think, how do you decide that two complex numbers are equal and implement it in code (Hint: you will need access to cimplex internal, so you should declare it friend, as with operator<<)
Also, you don't need both a member function and a global comparison operator. Just use the member function.
And whatever is at line 37 is not a comparison operator (it shouldn't take a std::ostream&, it should return a bool value which is the result of the comparison, ...)
Thanks for your advice, its just I'm getting more confused the more I think about it. Do you think you can tell me what lines like I need to delete and which are my member functions?
I'm guessing the +,-,etc. are my member functions and the += and -=, etc. are the global comparison operators.
Again, I haven't taken a class yet, I'm teaching myself at the moment, sorry if I sound like I don't know anything at all. It's just I've been at this example for hours . At this point, I wish I could just look at the solution code to teach myself, but the book doesn't provide solutions for even numbers and the more I read into these new codes and variables and what not, the more confused I am...
1) lines 48- 50 have no effect: there is return before them. You should remove excess code.
2) You cannot have friend definition inside class, only declaration. Move operator << definition outside class as you did there http://www.cplusplus.com/forum/general/112890/#msg617097 .
3) To give operator access to class internals you can use friend declaration. Look how it was done in case of operator<< and add similar declaration adapted to your class.