I have just learnt programming C++. I typed a program about operator on Borland C++ 502. When I compiled, the warning is: 'complex::real' is not accessible and 'complex::image' is not accessible. I don't know why. Please show me my errors. I really thanks everyone!
Your function on line 21 doesn't match the declaration on line 11, so the compiler then tries to create a new function that isn't a friend of the class. Careful with copy-paste :)
In other words, change line 11 to operator>>, not operator<<.
Thanks Ganado very much! I fixed this problem. I typed myself, not copy paste. I know that want to learn programming just code, code and code... I'm trying do that. Thank you again!
I think the point he was getting at was the following:
If you're doing it for a university, just stick with what they're telling you to do for now... but you should know that your code is outdated and would not compile on modern compilers. (The two main things being that main should return int, not void, and <iostream> should not be appended with .h, and also that conio.h is not a standard header)