类的构造函数
class Exception
{
public:
char str_what[256];
int ErrCode;
int m_sock;
Exception()
{
*str_what = 0; ErrCode =0;m_sock = 0;
}
Exception(const char* s,int err,SOCKET sock=0)//ERROR
{
m_sock = sock;
char *ord = const_cast<char*>(s);
char *des = str_what;
while(*(ord++))
{
*des = *ord;
des++;
}
*des = 0;
ErrCode = err;
}
~Exception(){}
};
编译时出现错误:
error C2629: unexpected 'class Exception ('
error C2334: unexpected token(s) preceding '{'; skipping apparent function body
请高人指教