We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64e1067 commit b364dd3Copy full SHA for b364dd3
c/fileio/src/r.c
@@ -1,9 +1,15 @@
1
#include "../include/head.h"
2
int r(const char* filename){
3
FILE *fp = fopen("file.txt","r");
4
- char a[100];
5
- fscanf(fp,"%s",a);
6
- printf("%s",a);
+ int i;
+ long location=-2;
+ while(ftell(fp)!=-1 && ftell(fp)!=location){
7
+ //location=ftell(fp);
8
+ //printf("location:%ld ",location);
9
+ char a[100];
10
+ fscanf(fp,"%s",a);
11
+ printf("%s \n\n",a);
12
+ }
13
fclose(fp);
14
return 0;
15
}
0 commit comments