所以我有这个.
#define MAX_MENU_OPTIONS 1
typedef struct _NEW_MENU_OPTION
{
char* name;
int type;
char* opt1;
int value1;
int cycleid;
int cycle_max;
int cycle_min;
int onenter;
} NEW_MENU_OPTION;
NEW_MENU_OPTION menu_options[MAX_MENU_OPTIONS];
Run Code Online (Sandbox Code Playgroud)
然后在我的代码中.
switch(menu_options[menu_location].onenter)
{
case 0:
break;
}
Run Code Online (Sandbox Code Playgroud)
但我在menu_options上有一个红色错误的东西,说"错误:表达式必须有整数或枚举类型".我真的很困惑,我看不出有什么不对,有什么不对?