-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact_test.c
76 lines (69 loc) · 1.2 KB
/
contact_test.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#define _CRT_SECURE_NO_WARNINGS 1
#include "contact.h"
//enum Sex
//{
// MALE,
// FEMALE,
// SECERT
//};
//
////联合体
//union Un
//{
// char c;
// int i;
//};
void menu()
{
printf("*********************************************\n");
printf("******* 1.add 2.del *******\n");
printf("******* 3.search 4.modify *******\n");
printf("******* 5.show 6.sort *******\n");
printf("******* 0.exit *******\n");
printf("*********************************************\n");
}
int main()
{
//enum Sex s = MALE;
//union Un u;
//printf("%d\n",sizeof(u));
//printf("%p\n", &u);
//printf("%p\n", &(u.i));
//printf("%p\n", &(u.c));
int input = 0;
struct Contact con;
InitContact(&con);
do
{
menu();
printf("请选择:>");
scanf("%d", &input);
switch (input)
{
case ADD:
AddContact(&con);
break;
case DEL:
DelContact(&con);
break;
case SEARCH:
SearchContact(&con);
break;
case MODIFY:
ModifyContact(&con);
break;
case SHOW:
ShowContact(&con);
break;
case SORT:
break;
case EXIT:
printf("quit\n");
break;
default:
printf("input error\n");
break;
}
} while (input);
return 0;
}