嗨我的if语句在这里不起作用是我的代码请帮忙吗?
case WM_COMMAND:
{
if (LOWORD(wParam) == 3); {
std::exit(EXIT_FAILURE);
}
break;
if (LOWORD(wParam) == 1); {
system("test.txt");
}
break;
}
我只是没有得到它!
答案 0 :(得分:2)
控制结构控制下一个括号或下一个半音的所有内容。你写的内容被解释为:
//This is a really short if, but okay
if (LOWORD(wParam) == 3);
//this is just a bracket that has nothing to do with the if that was already finished.
{
std::exit(EXIT_FAILURE);
}
答案 1 :(得分:0)
哦,我在这里解决了我的代码:
case WM_COMMAND: {
if (LOWORD(wParam) == 3) {
std::exit(EXIT_FAILURE);
}
if (LOWORD(wParam) == 1) {
system ("test.txt");
}
break;
}