【发布时间】:2014-10-31 00:35:01
【问题描述】:
我的程序是
int main() {
int i = 10;
int j = 20;
switch (i++, j--) {
case 10:
printf("The number is 10");
break;
case 20:
printf("The number is 20");
break;
default:
printf("Input Invalid");
}
return 0;
}
我得到了输出The number is 20。我需要知道它是如何工作的,你能解释一下。谢谢。
【问题讨论】:
标签: c++ switch-statement comma-operator