I can't find anything wrong this with this class. Especially,
Overloading Stream-Extraction Operator (in blue). Any one know what
do I need to fix this problem please reply. Thank you for your help!
---------------------------------------------
class MyData{
public:
int x;
float y;
bool operator==(MyData);
MyData operator=(MyData);
friend ostream &operator<<(ostream
&output, const MyData &obj);
};
bool MyData::operator==(MyData obj)
{
if(x==obj.x && y==obj.y)
return true;
else
return false;
}
MyData MyData::operator=(MyData obj)
{
x = obj.x;
y = obj.y;
return *this;
}
[color=blue:173fdd256e]ostream MyData::&operator<<(ostream
&output, const MyData &obj)
{
out<<"integer: "<<obj.x<<" float: "<<obj.y;
return output;
}
[/color:173fdd256e]
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com