技术的乐趣在于分享,欢迎多多交流,多多沟通。
全部博文(877)
分类: 嵌入式
2014-09-27 14:55:36
//test for switch
#include
#define SELECT_ONE 1
#define SELECT_TWO 2
#define SELECT_THREE 3
#define SELECT_FOUR 4
int main(int argc, char *argv[])
{
int var,bar,foo;
foo = SELECT_ONE;
var = SELECT_TWO;
switch(foo)
{
case SELECT_ONE :
{
printf("SELECT_ONE\n");
break;
}
case SELECT_TWO :
{
printf("SELECT_TWO\n");
//
switch(var)
{
case SELECT_TWO :
{
printf("switch_SELECT_TWO\n");
break;
}
default :
printf("switch_error\n");
break;
}
//
break;
}
default : printf("error\n");
}
return 0;
}