求助
请教高手,该程序如何改正.编绎时出现如下错误F:\C++程序设计\summer programming\未完成\point\point.cpp(15) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
执行 cl.exe 时出错.
point.exe - 1 error(s), 0 warning(s)
#include<iostream>
using namespace std;
class Point
{
public:
Point()
{
}
Point(double a,double b)
{
x=a;
y=b;
}
friend Point operator +(Point &p1,Point &p2)
{
Point temp;
temp.x=p1.x+p2.x;
temp.y=p1.y+p2.y;
return temp;
}
friend Point operator -(Point &p1,Point &p2)
{
Point temp;
temp.x=p1.x-p2.x;
temp.y=p1.y-p2.y;
return temp;
}
bool operator ==(Point &s)
{
if(x=s.x&&y=s.y)
return true;
else
return false;
}
bool operator !=(Point &s2)
{
if(x=s2.x&&y=s2.y)
return false;
else
return true;
}
void display()
{
cout<<"("<<x<<","<<y<<")"<<endl;
}
private:
double x;
double y;
};
void main()
{
Point s1(2.1,3.3),s2(3.2,4.4),s3(2.2,3.5),s4(5.9,7.3);
Point s,p;
s=s1+s2;
s.display();
p=s1-s2;
p.display();
cout<<(s1==s3)<<endl;
cout<<(s1!=s4)<<endl;
}