在VSCode下编译运行lab5-1

通过VSCode+GDB调试程序找出quit命令无法运行的bug产生的原因
int main()
{
InitMenuData(&head);
/* cmd line begins */
while(1)
{
printf("Input a cmd number > ");
scanf("%s", cmd);
tDataNode *p = FindCmd(head, cmd);
if( p == NULL)
{
printf("This is a wrong cmd!\n ");
continue;
}
printf("%s - %s\n", p->cmd, p->desc);
if(p->handler != NULL)
{
p->handler();
}
}
}






原文:https://www.cnblogs.com/qfdzztt/p/12525487.html