此题错在哪里?
#include <iostream> using namespace std;
class Point {
private:
int x;
int y;
public:
Point() { };
、/*friend ostream & operator << (ostream & o,const Point & s);
friend istream & operator >> (istream & is,const Point & s);
ostream & operator <<(ostream & o,const Point & s)
{
o<<s.x<<s.y;
return o;
}
istream & operator >> (istream & is,const Point & s)
{
is >>s.x>>s.y;
return is;
}
注释部分是我修改部分,您看错在哪里?
*/
};
int main()
{
Point p;
while(cin >> p) {
cout << p << endl;
}
return 0;
}
错误提示说 ostream & operator <<(ostream & o,const Point & s)只能有一个参数?