所以这是出现错误的代码行:
switch (ResultCalculation) {// expected indentifier or '/'
case = 0
Result = FirstNumber + SecondNumber;
break;
case = 1
Result = FirstNumber - SecondNumber;
break;
case = 2
Result = FirstNumber * SecondNumber;
break;
case = 3
Result = FirstNumber / SecondNumber;
default :// default statement not in switch statement
break ;// break statement not in loop or switch statement
}
答案 0 :(得分:3)
你的语法错了 - 它应该是:
switch (ResultCalculation) {
case 0: // <<< *** note the syntax for the case labels! ***
Result = FirstNumber + SecondNumber;
break;
case 1:
Result = FirstNumber - SecondNumber;
break;
// ...
default:
break;
}