#include<stdio.h>
typedef enum test_enum
{
one = 1,
two
}test_enum;
void test_print(test_enum a)
{
switch (a)
{
case one:
printf("this is one\n");
break;
case two:
printf("this is two\n");
default:
printf("no value match\n");
break;
}
}
int main()
{
test_print(1);
return 0;
}
枚举的测试demo
最新推荐文章于 2024-06-12 17:28:20 发布