模拟通讯录
c语言模拟 1 #include<stdio.h> 2 #include<string.h> 3 #define NAME_MAX 15 4 #define SEX_MAX 3 5 #define AGE_MAX 100 6 #define TEL_MAX 15 7 #define ADDR_MAX 20 8 #define PEOPLE_MAX 1000 9 10 typedef struct LINK 11 { 12 char name[15]; 13 char sex[SEX_MAX]; 14 int age; 15 char tel[TEL_MAX]; 16 char addr[ADDR_MAX]; 17 }linkman; 18 19 typedef struct PEOPLE 20 { 21 int num; 22 linkman count[1000]; 23 }*people; 24 25 26 //在通讯录里模糊搜索遍历到指定联系人 27 static int _search(people cou, const char *name) 28 { 29 int number = 0; 30 31 for (int i = 0; i < cou->num; i++) 32 { 33 if ((strstr((cou->count[i]).name, name) !=