高手帮我看看,怎么不能实现友元方式的运算符重载???
#include <iostream>
using namespace std;
class PPoint
{
public:
void set(int a,int b){x=a;y=b;};
friend PPoint operator+( int first, PPoint &second );
private:
float x, y;
};
PPoint operator+( int first, PPoint &second )
{
PPoint ss;
ss.set(first+second.x,second.y);
return ss;
}
void main()
{}