#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()
{}
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()
{}
不过打了SP6补丁的VC6.0或VC2003,VC2005不会出现这样的问题。类似情况都可以这么处理。