Advertisement
metalx1000

Read file Line by Line

Nov 29th, 2012
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(void){
  4.         FILE *file;
  5.         file=fopen("test.log","r");
  6.  
  7.         char line[128];
  8.         while(fgets(line,sizeof(line),file))
  9.                 fputs(line,stdout);
  10.         fclose(file);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement