Umm, my problem is this.
I have a friend function in my string class.
The class declaration in a .h file. The class implementation is in
a .cpp file.
If i define the friend function in the .cpp file i get this error :
<< is not a member of String
I want to overload the '<<' operator to provide printing for my
class. Here's what i'm doing:
Then I define the function in the .cpp file like this :
//This is the .h file
friend ostream& operator<<(ostream&, String&);
Where should i define friend functions OR what am I doing
ostream& operator<<(ostream& o, String& newStr)
return o << newStr.lpzstr;