c++中一个看不懂的错误

gjf66924011 gjf66924011 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include <iostream>
using namespace std;
class Complex
{
public:
Complex (double r,double im)
{real=r;imag=im;}
Complex (double r)
{real=r;}
Complex ()
{real=0;imag=0;}
Complex operator +(double &i)
{return Complex (real+i,imag);}
Complex operator +(Complex &x1)
{return Complex (real+x.real,imag+x1.imag);}
friend Complex operator +(double &i,Complex &x1);
void display()
{
cout<<"the sum of complexes are:"<<real<<"+"<<imag<<"i"<<endl;
}
private:
double real;
double imag;
};
Complex operator +(double &i,Complex &x1)
{
return Complex (i+x1.real,x1.imag);
}
int main()
{
Complex x,x1,x2,x3,i;
x2=x+x1;
x3=x+i;
cout<<"x=";x.display();
cout<<"x1=";x1.display();
cout<,"i=";i.display();
cout<<"x+x1=";x2.display();
cout<<"x+i=";display();
return 0;
}


错误提示是:
c:\users\asus\documents\tencent files\396549821\filerecv\22.cpp(16) : 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 时出错.


请指点错误。
还有,我用的是vc++6.0 我想换一个编译器,请推荐并留下下载地址,3Q
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
gjf66924011
C++ 语言 65,214 成员 250,514 内容