重载函数求助
#include<iostream>using namespace std;
class Point
{
public:
Point(){ x=0; y=0;}
Point(float a ,float b){ x=a; y=b;}
float GetX()const{return x;}
float GetY()const{return y;}
float area(){return 0;}
friend ostream & operator<<(ostream&,Point&);
protected:
float x;
float y;
};
ostream& operator <<(ostream &output,const Point &point)
{
output<<"("<<point.x<<","<<point.y<<")"<<endl; //提示这里没有访问权限,不是申请唯有原函数了吗?不懂。求助解疑
return output;
}
int main()
{
return 0;
}