This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IAR for msp430运行 (*menupoint[userchoose].subs)(); 程序就跑飞了?



truct menultem
{
unsigned char mencount;
unsigned char *displaystring;
void (*subs)();
struct menultem *childrenmenus;
struct menultem *parentmenus;
};    //结构体定义

struct menultem (*menupoint)=mainmenu; //结构体指针,指向结构体后由内部函数指针指向功能函数

unsigned char displaystart = 0; //显示时的第一个菜单项

unsigned char userchoose = 0; //用户所选菜单项
unsigned char displaypoint=0; //显示指针

case enter:
{
if(menupoint[userchoose].subs!=NULLsubs)
{
(*menupoint[userchoose].subs)();
keyval=0;
}
else
if (menupoint[userchoose].childrenmenus!=NULL)
{
menupoint=menupoint[userchoose].childrenmenus;
userchoose=0;
displaystart=0;
keyval=0;
}

上面是部分程序,不知道为什么程序一道(*menupoint[userchoose].subs)(); 这一句程序就跑飞了?