user-0 提问: 求大佬帮忙看看哪里出错了！！

回复:
user: user-0
content: 就是这个warning警告，求解啊啊

user: user-0
content: #include<stdio.h> #include<string.h> #include<malloc.h> #define SIZE 10 typedef struct Node { 	int Value; 	char name[SIZE]; 	struct Node *next; }SeqList; int main() { 	SeqList *create(); 	SeqList *Typein();  //   SeqList Insert(SeqList *L); 	SeqList Printf(SeqList *L); 	int i; 	SeqList *L; 	printf("\n/*****************************Welcome!******************************/"); 	printf("\n/                 Input  1  To InitList Linear List                 /"); 	printf("\n/                 Input  2  To Type-in Students Name                /"); 	printf("\n/                 Input  3  To Insert New Student Name              /"); 	printf("\n/                 Input  4  To Delete Student Name                  /"); 	printf("\n/                 Input  5  To Search Student                       /"); 	printf("\n/                 Input  6  To Print Students Name                  /"); 	printf("\n/                 Input  7  To Inversion Linked List                /"); 	printf("\n/                 Input  0  Exit                                    /\n"); 	printf("\nThe Value: "); 	scanf("%d",&i); 	switch(i) 	{ 	case 1:L=create();main();break; 	case 2:L=Typein();printf("\n%s %d\n",L->next->name,L->Value);main();break; //	case 3:Insert(L);main();break; 	case 6:Printf(L);main();break; 	case 0:exit();break; 	default :system("cls");printf("\nInput Error!\n");main();break; 	} } SeqList *create() { 	SeqList *p; 	p=(SeqList*)malloc(sizeof(SeqList)); 	p->next=NULL; 	p->Value=0; 	if(p->next==NULL) 	{ 		system("cls"); 		printf("\nCreate To Complete!\n"); 		return p; 	} 	else 	{ 		system("cls"); 		printf("\nError!\n"); 		return NULL; 	} } SeqList *Typein() { 	SeqList *head,*current,*next; 	char str[SIZE],flag='Y'; 	int i=0; 	head=(SeqList*)malloc(sizeof(SeqList)); 	current=head; 	system("cls"); 	while(flag=='Y'&&flag!='N') 	{ 		++i; 		printf("Please Input The No.%d Student's Name: ",i); 		scanf("%s",str); 		next=(SeqList*)malloc(sizeof(SeqList)); 		strcpy(next->name,str); 		current->next=next; 		current=next; 		getchar(); 		printf("Continue? Y/N-> "); 		scanf("%c",&flag); 	} 	current->next=NULL; 	head->Value=i; 	system("cls"); 	if(head->Value==i) 	{ 		printf("\nType-in Name To Complete!\n"); 		printf("Only %d Students\n",head->Value); 		return head; 		free(head); 	} 	else 	{ 		printf("\nError!\n"); 		return NULL; 	} } SeqList Printf(SeqList *L) { 	SeqList *p; 	system("cls"); 	printf("\nThe Students:\n"); 	p=L->next; 	while(1) 	{ 		printf("\n%s",p->name); 		if(p->next!=NULL)p=p->next; 		else 			break; 	} 	printf("\n\nOnly %d Students\n",L->Value); } 代码在这

user: user-1
content: #include <stdio.h> #include <string.h> #include<malloc.h>  #define SIZE 10 typedef struct Node {     int Value;     char name[SIZE];     struct Node *next; }SeqList;  /*Function statements */ SeqList *create(); SeqList *Typein(); //SeqList Insert(SeqList *L); SeqList Printf(SeqList *L);  int main() {     int ch;      SeqList *L = NULL; /*Initize link.*/      while (1) {         printf("\n/*****************************Welcome!******************************/");         printf("\n/                 Input  1  To InitList Linear List                 /");         printf("\n/                 Input  2  To Type-in Students Name                /");         printf("\n/                 Input  3  To Insert New Student Name              /");         printf("\n/                 Input  4  To Delete Student Name                  /");         printf("\n/                 Input  5  To Search Student                       /");         printf("\n/                 Input  6  To Print Students Name                  /");         printf("\n/                 Input  7  To Inversion Linked List                /");         printf("\n/                 Input  0  Exit                                    /\n");         printf("\nThe Value: ");         scanf("%d", &ch);         switch(ch)         {             case 1:                 L = create();                 //main();    /* what's this?*/                 break;              case 2:                 L = Typein();                 printf("\n%s %d\n", L->next->name, L->Value);                 //main();                 break;                  // case 3:Insert(L);main();break;             case 6:                 Printf(L);                 //main();                 break;              case 0:                 exit(0);                 break;              default :                 system("cls");                 printf("\nInput Error!\n");                 //main();                 break;         }     } }  SeqList *create() {     SeqList *p;     p=(SeqList *)malloc(sizeof(SeqList));     p->next = NULL;     p->Value = 0;     if(p->next == NULL)     {         system("cls");         printf("\nCreate To Complete!\n");         return p;     }     else     {         system("cls");         printf("\nError!\n");         return NULL;     } }  SeqList *Typein() {     SeqList *head, *current, *next;     char str[SIZE], flag='Y';     int i = 0;      head = (SeqList*)malloc(sizeof(SeqList));     current = head;     system("cls");     while(flag == 'Y' && flag != 'N')     {         ++i;         printf("Please Input The No.%d Student's Name: ", i);         scanf("%s",str);         next = (SeqList*)malloc(sizeof(SeqList));         strcpy(next->name,str);         current->next=next;         current=next;         getchar();         printf("Continue? Y/N-> ");         scanf("%c", &flag);     }     current->next = NULL;     head->Value = i;     system("cls");     printf("\nType-in Name To Complete!\n");     printf("Only %d Students\n", head->Value);     return head; } SeqList Printf(SeqList *L) {     SeqList *p;     system("cls");     printf("\nThe Students:\n");     p = L->next;     while (p)     {         printf("\n%s", p->name);         p = p->next;     }     printf("\n\nOnly %d Students\n",L->Value); } 那个警告是main函数定义的变量L没有初始化; 程序中的问题： 1. 编程这么长时间，第一次看到有对main函数做递归的。能用递归的也可以用迭代实现，在外层加一个while或者for循环就可以，用main递归，真的很少有人这样做，对于不是很了解递归的，递归有自己的缺点 ； 2. 函数声明，不要放到main函数里，很少有人这么做了，这样的”陋习“建议改掉，能放到函数外或者用头文件都可以。 3. create()没看出有什么用途，调用了，但是后面没有用呢。建议去掉或者改改其他函数功能，Typein函数做了create函数应该做的事情；既然重复，那就删掉冗余的代码； 4. Print输出链表，完全可以做的简单些，没必要在while中再做判断； 5. typein函数里，current->value = i;下面为啥还要判断current->value==i呢?要验证上面的赋值是否正确吗？不用验证，是没问题的。所以，这块也是多余，要么就是你有其他的想法。  最后，注意下coding style.