Whenever I try to compile my program, I get a strange error. I have tried to look it up, and trying different methods of overloading it, but I still get errors.
istream& operator >> ( istream& in, MysteryCard& theMysteryCard )
{
int value;
in >> value;
theMysteryCard.change(value);
return in;
}
All of my variables are right, and the functions work, but I do not know why it isn’t working.
13 no match for
'operator>>'in'in >> value'
The change function is public as well.
It appears to me that you’re missing an include. Make sure you have
#include <istream>and that you have either a using declaration forstd::istreamor a using directive fornamespace std.