功能程序框架
时间:2010-10-18 来源:saysomething
主函数框架
/*
*/
#include "MgrCtrl.h" int main()
{
MgrCtrl(); return 0;
} MgrCtrl()函数; /*MgrCtrl.h*/
#include <stdio.h>
#include <stdlib.h> #include "add_record.h"
#include "search_record.h"
#include "modify_record.h"
#include "delete_record.h" int menu_main()
{
int a=-1; printf("+---------------------------+\n");
printf("| 1-add |\n");
printf("| 2-search |\n");
printf("| 3-modify |\n");
printf("| 4-delete |\n");
printf("| 0-退出 |\n");
printf("+---------------------------+\n");
printf("请输入选择(0-4)\n");
scanf("%d",&a); return a;
} void MgrCtrl()
{
int a; a=menu_main();
switch(a)
{
case 0:
exit(0);
break;
case 1:
add_record();
break;
case 2:
search_record();
break;
case 3:
modify_record();
break;
case 4:
delete_record();
break;
}
} add_record函数 /*add_record.h*/ /*************************************************
*函数名:add_record
*功能:添加记录
*入口参数:void
*返回值:int a
**************************************************/ void add_record()
{
printf("add_record()\n");
} /*search_record.h*/ void search_record()
{} /*modify_record.h*/ void modify_record()
{} /*delete_record.h*/
void delete_record()
{} /*
user.h
*/ struct usr
{
char num[10];
char name[20];
int data;
};
#include "MgrCtrl.h" int main()
{
MgrCtrl(); return 0;
} MgrCtrl()函数; /*MgrCtrl.h*/
#include <stdio.h>
#include <stdlib.h> #include "add_record.h"
#include "search_record.h"
#include "modify_record.h"
#include "delete_record.h" int menu_main()
{
int a=-1; printf("+---------------------------+\n");
printf("| 1-add |\n");
printf("| 2-search |\n");
printf("| 3-modify |\n");
printf("| 4-delete |\n");
printf("| 0-退出 |\n");
printf("+---------------------------+\n");
printf("请输入选择(0-4)\n");
scanf("%d",&a); return a;
} void MgrCtrl()
{
int a; a=menu_main();
switch(a)
{
case 0:
exit(0);
break;
case 1:
add_record();
break;
case 2:
search_record();
break;
case 3:
modify_record();
break;
case 4:
delete_record();
break;
}
} add_record函数 /*add_record.h*/ /*************************************************
*函数名:add_record
*功能:添加记录
*入口参数:void
*返回值:int a
**************************************************/ void add_record()
{
printf("add_record()\n");
} /*search_record.h*/ void search_record()
{} /*modify_record.h*/ void modify_record()
{} /*delete_record.h*/
void delete_record()
{} /*
user.h
*/ struct usr
{
char num[10];
char name[20];
int data;
};
相关阅读 更多 +