新人求助,怎样做一个菜单循环
程序代码:
void showmenu() { printf("\t\t---------------------------\n"); printf("\t\t 英汉电子辞典 \n"); printf("\t\t---------------------------\n"); printf("\t\t*** 【1】显示词条 ***\n"); printf("\t\t*** ***\n"); printf("\t\t*** 【2】查找词条 ***\n"); printf("\t\t*** ***\n"); printf("\t\t*** 【3】修改词条 ***\n"); printf("\t\t*** ***\n"); printf("\t\t*** 【4】 退出 ***\n"); printf("\t\t---------------------------\n"); printf("\t\t 请选择:"); } void selectmenu() { int sel; scanf("%d",&sel); //这边怎么做成循环 switch(sel) { case 1:show_dictionary();break; case 2:search(); break; case 3:modify(); break; case 4:exit(0); } }
求助怎么样做一个循环菜单,选择的函数执行结束后可以回到主菜单