下面程序在vc6.0里面运行报错!请指教!报错在后面有提示!
**********************************
#include <iostream>
using namespace std;
class Test
{
public:
Test(int a = 0)
{
Test::a = a;
}
friend Test operator +(Test,Test);
friend Test operator ++(Test);
public:
int a;
};
Test operator +(Test temp1,Test temp2)//+运算符重载函数
{
//cout<<temp1.a<<"|"<<temp2.a<<endl;//在这里可以观察传递过来的引用对象的成员分量
Test result(temp1.a+temp2.a);
return result;
}
Test operator ++(Test temp)//++运算符重载函数
{
temp.a++;
return temp;
}
int main()
{
Test a(100);
Test c=a+a;
cout<<c.a<<endl;
c++;
cout<<c.a<<endl;
}
***********************************************
--------------------Configuration: ddd - Win32 Debug--------------------
Compiling...
Text2.cpp
D:\source\ddd\Text2.cpp(10) : 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 时出错.
Text2.obj - 1 error(s), 0 warning(s)