Hi everybody,
I just started programming with classes.
Everything was fine until when I saw this expression:
MyClass& operator= (const MyClass&);
It was inside the definition of the class "MyClass". I know what are operators and how they should work, but I don't get the use of the "&" before "operator" and of the one before " ) ".
I still don't get it...MyClass& operator= (const MyClass&); should be the declaration of the overloading of a operator right? but then what does the first "&" indicate?
for what concerns the second "&", it's the first time I see it used with the postponed notation. Is there any difference?
int i; //normal variable
int* p; //pointer
int& r; //reference
int f(); //function returning a normal value
int* g(); //function returning a pointer
int& h(); //function returning a reference