c++中一个看不懂的错误
#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
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
...全文
相关推荐
C++ .h和.cpp文件总结
总结了.h文件能做什么,.cpp文件能做什么,总结了.h文件的本质,方便新手在遇到文件包含、类型声明、变量定义时能理清.h与.cpp关系,纯属个人总结文档。
【C++】VS中读写操作(fclose.cpp)引发中断——将一个无效参数传递给了将无效参数视为严重错误的函数
【C++】VS中读写操作(fclose.cpp)引发中断——将一个无效参数传递给了将无效参数视为严重错误的函数
cpp-rpc:简单的 C++ rpc 库
这是什么? 这是我的博客文章的 C++ rpc 示例程序。 如何运行这个例子? 将 BOOST_INCLUDE、BOOST_LIB64 宏设置为正确的路径。
C++实现的Fins库文件源代码 FinsLib_CPP.zip
C++实现的Fins库文件源代码,可以集成到自己的应用中与欧姆龙PLC通信
c++版yaml库yaml-cpp
c++版yaml库yaml-cpp


