我写了一个使用了 switch 语句的程序,但是编译时出现以下错误:
Error: Jump to case label.
为什么会这样?
#include <iostream>
int main()
{
int choice;
std::cin >> choice;
switch(choice)
{
case 1:
int i=0;
break;
case 2: // error here
}
}
case
块中加入了大括号? - Cody Gray