帮忙看一下,,高分,,再线等
ylmg 2002-12-07 07:58:50 在vc++ 6.0下编译下列代码:
#include <iostream.h>
#include <list>
using namespace std;
class MYOBJECT
{
private:
list <int> newlist;
public:
MYOBJECT()
{
}
friend MYOBJECT & operator -(const MYOBJECT &obj1,const MYOBJECT &obj2);
};
出现:
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
错误,
当把其中的语句: friend MYOBJECT & operator -(const MYOBJECT &obj1,const MYOBJECT &obj2);
改为 friend MYOBJECT & operator -=(const MYOBJECT &obj1,const MYOBJECT &obj2);
(区别在把"-"改为"-="了,也可以把"operator -"改为一个别的函数名)
编译就没有错误了.
请问这是怎么回事,我的vc++编译别的代码没问题啊,
请高手作答