fstream& operator>> (fstream & in, class& obj);
fstream& operator<< (fstream & out, class& obj);
Is this overloading legal or not?
And what is it's solution?
Actually l am using files in a program with the help of fstream class objects. So I need to overload >>&<< operators so that such statements can work.
File>>obj; File<
But would ifstream& operator >> (ifstream & , classname& obj) ofstream& operator >> (ofstream & , classname& obj)
Work for fstream objects?