Guest User

Untitled

a guest
Nov 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. main() {
  4.  
  5. FILE *fp;
  6. char buff[255];
  7.  
  8. fp = fopen("/tmp/test.txt", "r");
  9. fscanf(fp, "%s", buff);
  10. printf("1 : %s\n", buff );
  11.  
  12. fgets(buff, 255, (FILE*)fp);
  13. printf("2: %s\n", buff );
  14.  
  15. fgets(buff, 255, (FILE*)fp);
  16. printf("3: %s\n", buff );
  17. fclose(fp);
  18.  
  19. }
Add Comment
Please, Sign In to add comment