Code:I have class C{ ... C& operator<<(C& os, const char* str) { ... } void display() { Is there anyway I can call operator<< in here? }
Code:I have class C{ ... C& operator<<(C& os, const char* str) { ... } void display() { Is there anyway I can call operator<< in here? }
If you don't actually need to directly access any private member variables, then make that member function into a non-member non-friend function.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
thank you