Yeah I'm not familiar with this method either. It seems like its acting like it prints that function with the cout whenever an "Apple& **operator here**" is CHANGED?
It seems (const Apple& anApple) is the function arguement area, and operator= is not a function name but a keyword saying if an operator of Apple& is changed then it calls that. And of course its using references and reference to reference to keep the correct value.Code:
Apple& operator=(const Apple& anApple)
cout<<"assignment operator called"<<endl;
num = anApple.num;
I dunno, and whats with return *this;? I've read it in win32 tutorials but I never knew what "this" really meant.