高手帮忙看看 为什么我运行后自动有值输出了 我都还没输入呢 求求.........
#include <stdio.h>typedef struct gradeinfo
{
int score;
struct gradeinfo *next;
}node;
node *linklist()
{
node *head, *tail, *pnew;
int score;
head=(node *)malloc(sizeof(node));
if(head==NULL)
{
printf("no enough memory!\n");
return (NULL);
}
head->next=NULL;
tail=head;
printf("input the student the score:\n");
while(1)
{
scanf("%d", &score);
if(score<0)
break;
pnew=(node *)malloc(sizeof(node));
if(pnew==NULL)
{
printf("no enouge memory!\n");
return (NULL);
}
pnew->score=score;
pnew->next=NULL;
tail->next=pnew;
tail=pnew;
}
return (head);
}
void main()
{
printf("the result is %d", linklist);
getch();
}
为什么我运行后自动有值输出了 我都还没输入呢