Y
yeutim
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:perator==(MyData obj)
{
if(x==obj.x && y==obj.y)
return true;
else
return false;
}
MyData MyData:perator=(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]
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:perator==(MyData obj)
{
if(x==obj.x && y==obj.y)
return true;
else
return false;
}
MyData MyData:perator=(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]