前言
C语言实现链表的创建、插入、删除和打印
一、代码实现
#include<stdio.h>
#include<stdlib.h>
struct Student
{
char cName[20]; /*姓名*/
int iNumber; /*学号*/
struct Student* pNext; /*指向下一个结点的指针*/
};
int iCount; /*全局变量表示链表长度*/
struct Student* Create()
{
struct Student* pHead=NULL; /*初始化链表头指针为空*/
struct Student* pEnd,*pNew;
iCount=0; /*初始化链表长度*/
pEnd=pNew=(struct Student*)malloc(sizeof(struct Student));
printf("please first enter Name ,then Number\n");
scanf("%s",&pNew->cName);
scanf("%d",