大家来找茬,一道链表基础题
大家来找茬,一道链表基础题,你能发现问题并修改吗?
顺便测测你的基本功
顺便测测你的基本功

#include "stdafx.h"
#include "malloc.h"
#include "string"
typedef struct FileList{
int num;
struct FileList *pnext;
}FileList;
int main()
{
FileList *first_file;
FileList *last_file,*file;
int num;
first_file = NULL;
last_file = first_file;
while(1)
{
printf("please input num\n");
scanf("%d",&num);
if (num<0)
{
printf("quit");
return -1;
}
file = (FileList *)malloc(sizeof(FileList));
memset(file,0,sizeof(FileList));
file->num=num;
last_file=file;
last_file=file->pnext;
}
return 0;
}
...全文


