#include<stdio.h> #include<stdlib.h> struct link{ int info; struct link *next; }; typedef struct link *Plink; void main() { int n=0; //int da; FILE *fp; Plink p; p=(Plink)malloc(sizeof(struct link)); if((fp=fopen("d:\\f.txt","r"))==NULL) { printf("cannot open file\n"); exit(0); } while(fscanf(fp,"%d",&p->info)!=EOF) { fscanf(fp,"%d\t",&p->info); printf("%d\n",p->info); } fclose(fp); }
by: 发表于:2017-06-20 16:14:49 顶(0) | 踩(0) 回复
??
回复评论