-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.c
44 lines (39 loc) · 1.07 KB
/
menu.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*********************************************************/
/* */
/* MENU : program which prints out a menu */
/* */
/*********************************************************/
#include <stdio.h>
char *menutext(int n);
int main ()
{ int str_number;
int main_choice;
for (str_number = 0; str_number < 13; str_number++)
{
printf ("%s",menutext(str_number));
}
main_choice = getchar();
printf( "\nYou entered: ");
putchar( main_choice);
return 0;
}
/*********************************************************/
char *menutext(n)
/* return n-th string ptr */
int n;
{
static char *t[] ={"-------------------------------------- \n",
" |++ MENU ++|\n",
" |~~~~~~~~~~~~|\n",
" |(1) Create Flightplan|\n",
" |(2) List current Flightplans|\n",
" |(3) Adapt Flightplan |\n",
" |(4) Some other function|\n",
" |(q) Quit|\n",
" ||\n",
" ||\n",
" |Please Enter Choice|\n",
" ||\n",
"-------------------------------------- \n"};
return (t[n]);
}