operator<< cout overload | SoloLearn: Learn to code for FREE!

0

operator<< cout overload

I recently watched a c++ video of "The Cherno Project" - copying and copy constructors, and on that video he overloaded cout << operator, well i got confused because he doesnt write the function declaration, only the implementation outside of the class, also he passes an ostream object as parameter, couldnt he just use This? To sum up i would like help on overloading << cout operator, and some explanation since im confused https://code.sololearn.com/cpkb0iLDHSnZ/?ref=app

10/8/2019 6:49:42 PM

Denomycor

1 Answer

New Answer

0

I anexed a example code, im not sure if it is correct, but i tried to reproduce it accuratly