首页 > 应用开发 > > c语言中switch在这个代码中咋执行的
int i = 0;
while (i < 3)
{
switch (i++)
{
case 0: printf("fat ");
case 1: printf("hat ");
case 2: printf("cat ");
default:printf("Oh no!");
}
putchar('\n');
}
不应该先是i=0,然后0<3, 0+1=1, 执行case1以及以后的语句嘛
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4295/viewspace-3153775/ ,如需转载,请注明出处,否则将追究法律责任。