我在c中有以下代码:
typedef enum
{
Filter_NAME,
Filter_NAME_2,
Filter_NAME_3
} Filter;
void printInfo(int filter)
{
switch()
{
case Filter_NAME:
// code part1
case Filter_NAME_2:
// code part2
case Filter_NAME_3:
// code part3
default:
return;
}
}
void main()
{
int filter = Filter_NAME;
printInfo(filter);
return 0;
}
我只想要执行,code part1
但全部执行,问题是什么以及如何解决?code part1
code part2
code part3