![]() |
overloading of operators in C++ Hello everyone, I wanted to know if there's anyone who can help me with this problem: I'm writing a program in C + + in which I have defined some classes and I did the overloaded operators <<and>> for items related to these classes, but when I compile error: here you put a piece of code: Code: class data (public int G,public int M,public int A, no match for 'operator <<' in 'dest <<((person) * this) -> person:: BIRTH' Why? How do I solve this problem? Thanks in advance to those who answered! |
Re: overloading of operators in C++ The next time refers to the code, otherwise you do not understand anything. Code: class data |
Re: overloading of operators in C++ ok, you're right ... the error is on this line of class "person" in the function "print": Code: dest <<BIRTH; |
Re: overloading of operators in C++ Move those operators <<before the definition of classes. It is also good use never use variables State capitals. For the reading of the code will also put a space between operators and arguments. |
All times are GMT +5.5. The time now is 05:55 PM. |