Skip to content

Instantly share code, notes, and snippets.

@axgle
Created October 30, 2009 04:49
Show Gist options
  • Save axgle/222131 to your computer and use it in GitHub Desktop.
Save axgle/222131 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
FILE *f;
f=fopen("data.txt","w");
int i=0;
for(i=0;i<10;i++)
fprintf(f,"thisi is a test %d\n",i);
fclose(f);
FILE *ff;
char s[255];
ff=fopen("data.txt","r");
while(fgets(s,255,ff)){
printf(s);
}
fclose(ff);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment