- 论坛徽章:
- 0
|
void commmandWork(char* cmdChar)
{
BASE_COMMAND* cmd = (BASE_COMMAND*)cmdChar;
DWORD cmdType = cmd->cmdType;
switch(cmdType)
{
case LOGOUT:
printf("Fuck you!");
break;
case LOGIN:
LOGIN_COMMAND* loginCmd = (LOGIN_COMMAND*)cmd;
printf("the login name is %s\n", loginCmd->mLoginName);
printf("the login password is %s\n", loginCmd->mPassword);
printf("shi");
break;
default:
printf("sdf");
}
} |
竟然报错,以下是报错的信息。请教各位大虾:
Compiling...
MsgQueue.cpp
E:\workspace\MsgQueue\MsgQueue.cpp(27) : error C2361: initialization of 'loginCmd' is skipped by 'default' label
E:\workspace\MsgQueue\MsgQueue.cpp(22) : see declaration of 'loginCmd'
Error executing cl.exe.
MsgQueue.exe - 1 error(s), 0 warning(s) |
|