请看看这个运算符重载有什么错误
complex complex::operator /(complex &c)<BR>{<BR> complex temp;<BR> temp.m_fReal=(m_fReal*c.m_fReal+m_fImag*c.m_fImag)/(c.m_fReal*c.m_fReal+c.Imag*c.Imag);<BR> temp.m_fImag=(m_fImag*c.m_fReal-m_fReal*c.m_fImag)/(c.m_fReal*c.m_fReal+c.Imag*c.Imag);<BR> return temp;<BR>}<BR>编译时提示有如下错误:<BR>F:\DiagnosisSystem\complex.cpp(57) : error C2296: '*' : illegal, left operand has type 'double (__thiscall complex::*)(void)'<BR>F:\DiagnosisSystem\complex.cpp(57) : error C2297: '*' : illegal, right operand has type 'double (__thiscall complex::*)(void)'<BR>F:\DiagnosisSystem\complex.cpp(58) : error C2296: '*' : illegal, left operand has type 'double (__thiscall complex::*)(void)'<BR>F:\DiagnosisSystem\complex.cpp(58) : error C2297: '*' : illegal, right operand has type 'double (__thiscall complex::*)(void)'<BR>DiagnosisSystem.cpp<BR><BR>谢谢大家了!回复:(shanghai)请看看这个运算符重载有什么错误
数据类型不对
页:
[1]