链表没法输入超过四组数据,而且为什没有实现头插
链表无法输入超过四组数据,而且为什没有实现头插?
#include<stdio.h>
#include<stdlib.h>
typedef struct Lnode{
char name[10];
long num;
int score[3];
struct Lnode *next;
}Lnode;
Lnode L;
int state=0;
int length=0;
void Homepage();
void list_create(Lnode *L);
void list_insert(Lnode *L);
int list_delete(Lnode *L);
void get_tail_data(Lnode L,int *e);
void print(Lnode *L);
int main(void)
{
Homepage();
return 0;
}
void Homepage()
{
char choice;
while(1){
printf(" \n\tManagement System for Students' Information\n");
printf(" \t\tc--> Create a empty archive\n");
printf(" \t\ts--> Storage students' information\n");
printf(" \t\td--> Delete a student's information\n");
printf(" \t\tg--> Go through the information\n");
printf(" \t\tq--> Quit\n");
printf("Choose what you want to do:\n");
scanf(" %c",&choice);
switch(choice)
{
case 'c':
if(state==0){
list_create(&L);
state=1;
printf("\n **Empty archive be created!**\n");
}
else{
printf("\n **Archive had been created ago!**\n");
}
break;
case 's':
if(state==1){
list_insert(&L);
}
else{
printf("\n **No archive be created,please create the archive firstly!**\n");