发现大部份的文章对于链表的基本办法讲述很隐约,今天我为大家依据这个“通信录”细心讲授一下链表的的操作。
第一步:定义头文件文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
include<stdlib.h>
include<windows.h> //清屏操作
include<stdio.h>
include<io.h>
include<malloc.h>
typedef struct Node
{
char id[30]; //用户ID
char name[30]; //用户姓名
char nex[10]; //用户性别
char number[30]; //用户电话号码
char birthday[30]; //用户生日
char address[30]; //用户家庭地址
struct Node *Next; //指针域
}Stu,*PStu;
void menu
{
printf;
printf;
printf;
printf;
printf;
printf;
printf; //借助ID进行排序
printf;
}
PStu createlist
{
PStu headNode = malloc);
headNode -> Next = NULL;
return headNode;
}
void addNode
{
PStu head = malloc);
printf;
scanf;
printf;
scanf;
printf;
scanf;
printf;
scanf;
printf;
scanf;
printf;
scanf;文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
head->Next = headNode->Next ;
headNode->Next = head; 文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
}
void endNode
{
PStu temp = headNode;
while
{
temp = temp ->Next ;
}
if
{
PStu s = malloc);
temp->Next = s;
temp = s;
printf;
scanf;
printf;
scanf;
printf;
scanf;
printf;
scanf;
printf;
scanf;
printf;
scanf;
temp ->Next = NULL;
}
}
void printList
{
PStu r = headNode->Next ;
while
{
printf;
r = r->Next;
}
}
void delectNode
{
PStu posNode = headNode->Next ;
PStu posfrontNode = headNode;
if
{
printf;
return ;
}
else
{
while)
{
posfrontNode = posNode;
posNode = posNode->Next;
if
{
printf;
return;
}
}
posfrontNode->Next = posNode->Next ;
free;
}
}
PStu reviseNode
{
PStu head = headNode;
while
{
if)
{
head = head->Next;
}
else
break;
}
return head;
}
PStu gai
{
PStu p = headNode;
char address_[30];
char number_[20];
char id_[15];
char nex_[4];
int a,i;
char birthday_[20],name_[20];
printf;
scanf;
getchar;
for
{
p = p->Next;
}
printf;
printf;
//getchar;
char w = getchar;
getchar;
if
{
int id;
printf;
scanf;
getchar;
strcpy;
}
if
{
printf;
scanf;
getchar;
strcpy;
}
if
{
printf;
scanf;
strcpy;
}
if
{
printf;
scanf;
strcpy;
}
if
{
printf;
scanf;
strcpy;
}
if
{
printf;
scanf;
strcpy;
}
return p;
}
void maopao
{
PStu t;
PStu u;
char name_[30],id_[30],nex_[20],birthday_[30],number_[30],address_[30];
for
{
for
{
if>0)
{
strcpy;
strcpy;
strcpy;文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
strcpy;
strcpy;
strcpy;文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
strcpy;
strcpy;
strcpy;文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
strcpy;
strcpy;
strcpy;文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
strcpy;
strcpy;
strcpy;文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
strcpy;
strcpy;
strcpy;
}
}
}
}文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
以上就是微观生活(93wg.com)关于“C语音编写通信录(一块儿学习单链表的操作办法)”的详细内容,希望对大家有所帮助!文章源自微观生活(93wg.com)微观生活-https://93wg.com/2713.html
评论