overloaded >> operator problem
I am trying to overload an the >> operator for my new Money class. It compiles fine, however when it gets to the point where i use the operator it, seems to loop the input method for a while and then end the program skipping any code after it. Any ideas?
void input(istream &in) const;
istream & operator>> (istream & in, const Money & m);
cents = cent;
void Money::input(istream &in) const
//THIS IS WHERE IT LOOPS UNTIL ENDING THE PROGRAM
in >> cents;
istream& operator>>(istream & in, const Money &m)
m.input( in );
The program never allows you to enter anything from the cin >> cents command. I have more code, but i am trying to simplify it...if you need to see more, let me know.
cin >> m;