VC++6.0出现系统不支持的错误怎么办

来源:互联网 发布:linux tcp ip协议栈 编辑:程序博客网 时间:2024/04/29 07:48

如出现近似问题

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

把    #include<iostream>

        using namespace std;

改为  #include<iostream.h>

因为VC++6.0没有完全实现C++标准库

//#include<iostream>//using namespace std;#include<iostream.h>class Complex{public:Complex(double r=0.0,double i=0.0){real=r;imag=i;}friend Complex operator+(Complex &a,Complex &b); //声明友元函数的重载“+”friend Complex operator-(Complex &a,Complex &b);friend Complex operator*(Complex &a,Complex &b);friend Complex operator/(Complex &a,Complex &b);void display();protected:double real;//复数实部double imag;//复数虚部};Complex operator+(Complex &a,Complex &b){Complex  temp;temp.real=a.real+b.real;temp.imag=a.imag+b.imag;return temp;}Complex operator-(Complex &a,Complex &b){Complex  temp;temp.real=a.real-b.real;temp.imag=a.imag-b.imag;return temp;}Complex operator*(Complex &a,Complex &b){Complex  temp;temp.real=a.real*b.real;temp.imag=a.imag*b.imag;return temp;}Complex operator/(Complex &a,Complex &b){Complex  temp;temp.real=a.real/b.real;temp.imag=a.imag/b.imag;return temp;}void Complex::display(){   cout<<real;if(imag>0) cout<<"+";if(imag!=0) cout<<imag<<"i\n";}int main(){Complex A1(2.3,4.6),A2(3.6,2.8),A3,A4,A5,A6;A1.display();cout<<"-----------------------\n";A2.display();cout<<"-------------------------\n";A3=A1+A2;    A3.display();cout<<"--------------------------\n";A4=A1-A2;A4.display();cout<<"--------------------------\n";A5=A1*A2;A5.display();cout<<"--------------------------\n";A6=A1/A2;A6.display();return 0;}


原创粉丝点击