帮忙看看怎么回事C++错误:fatal error C1001: INTERNAL COMPILER ERROR

#include<iostream>
using namespace std;
class Person
{
friend void operator-(Person);//错误箭头指在这一行
private:
int iApple;
public:
Person(int iApple);
void operator-();
void display;
};
void operator-(Person);
int main()
{
Person XiaoWang(5);
cout<<"\n调用operator-()负号符函数前"<<endl;
XiaoWang.display();
operator-(XiaoWang);
cout<<"\n调用operator-()负号运算符函数后"<<endl;
XiaoWang.display();
return 0;

}
Person::Person(int iApple)
{
this->iApple=iApple;
}
void operator-(person p1)
{pi.iApple=-iApple;

}
void person::display()
{
cout<<"iApple"<<iApple<<endl;
}

e:\project\lal.cpp(5) : 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

这一般是编译器内部运行的错误,与你的原程序是没有什么关系的。出现这种错误时,重新编译一下应该可以成功,如果还是不成功的话,可以试试重新启动开发环境,必要是重启系统。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-05-24

这东西刚出现了,没看你的代码,看过CSDN大佬的方法,是一种可靠地解决途径,但是没有解决我的问题。

忘记输入参数表也会造成这个错误

0.0

第2个回答  2013-01-28
把#include <iostream>改为#include <iostream.h>
再把using namespace std;这句删掉
相似回答