编译的时候出现警告了 求解决
程序代码:
typedef struct users{ char name[20]; int age; char f_word[200]; struct usres *link; }User; #include"include.c" #include"struct.c" #include"file.c" int main(){ FILE *f; User *new = NULL; User *start = NULL; User *up = NULL; char f_name[20]; int i = 0; printf("scanf oprn file name:"); gets(f_name); f = fopen(f_name,"ab+"); while(!feof(f)){ //这读取会多出一行 知道为什么但是不知道如何解决它 if(start == NULL){ up = start = new = (User *)malloc(sizeof(User)); }else{ new = (User *)malloc(sizeof(User)); up->link = new; //这提示了警告 up = new; } fread(new,sizeof(User),1,f); } while(start!=NULL){ printf("name:%s\t age:%d\t word:%s\n",start->name,start->age,start->f_word); start = start->link; //这提示了警告 } fclose(f); }