using namespace std;//(1)
//#include
class Point
{
int x,y;
public:
Point(int x1=0,int y1=0){x=x1;y=y1;}
friend istream &operator>>(istream&input,Point &obj);
friend ostream &operator<<(ostream&output,Point &obj);
};
istream &operator>>(istream&input,Point &obj)
{
input>>obj.x>>obj.y;
return input;
}
ostream &operator<<(ostream&output,Point &obj)
{
output<
}
int main()
{
Point obj1,obj2;
cin>>obj1>>obj2;
cout<
}
用(1)后 出现了如下错误
'x' : cannot access private member declared in class 'Point' 这类错误有4个
'operator <<' is ambiguous 这类错误有2个 如何改正哦
我用C++6.0和VS2008编译器都显示有这些错误 貌似和编译器无关吧?