#include <stdio.h>
#include<stdlib.h>
#include<string.h>
//#define NULL 0
#define LEN sizeof(struct Student)
struct Student
{
int num;
char name[10];
char sex[3];
struct Student*next;
};
struct Student Stu[30]={
{1,"陈文宇","M",NULL},
{2,"毛泽权","M",NULL},
{3,"杨继福","M",NULL},
{4,"朱志文","M",NULL},
{5,"陈立军","M",NULL},
{6,"蔡鸿飞","M",NULL},
{7,"王胜","M",NULL},
{8,"王丽娜","M",NULL},
{9,"葛兰","M",NULL},
{10,"袁璇","M",NULL},
{11,"陶钧溢","M",NULL},
{12,"章安刘","M",NULL},
{13,"王卫","M",NULL},
{14,"关慧敏","M",NULL},
{15,"王胤翔","M",NULL},
{16,"赵于意","M",NULL},
{17,"王冕","M",NULL},
{18,"茹冬","M",NULL},
{19,"潘柏儒","F",NULL},
{20,"张梦缘","F",NULL},
{21,"陈春旭","F",NULL},
{22,"李壮伟","F",NULL},
{23,"闻婉婉","F",NULL},
{24,"孙丹","F",NULL}
};
struct Student*creat();
void printlist(struct Student *head);
struct Student*creat1();
struct Student*delNode(struct Student*head);
struct Student*update(struct Student*head);
struct Student*add(struct Student*head);
//************************************
struct Student *creat1()
{
struct Student *head;
head = NULL;
head = &Stu[0];
int i;
for(i=0;i<24;i++)
Stu[i].next = &Stu[i+1];
Stu[i-1].next = NULL;
return head;
}
//********************
struct Student*creat()
{
struct Student*head,*p1,*p2
C语言学习(六)运用链表实现简易通讯录功能
最新推荐文章于 2021-07-27 16:22:59 发布
这个博客介绍了如何使用C语言构建一个简单的通讯录功能,包括创建链表、查看、删除、更新和添加成员等操作。通过定义一个学生结构体,程序实现了对通讯录成员的增删改查。
摘要由CSDN通过智能技术生成