Advertisement
NightRaven97

Reading contents from file

Apr 27th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. //Reading contents from file
  2. //File creation and adding contents => http://pastebin.com/TzifWJbQ
  3. #include<stdio.h>
  4. #include<conio.h>
  5. void main()
  6. {
  7.  FILE *test;
  8.  char str[60];
  9.  test=fopen("test.txt","r+");
  10.  if(fgets(str,60,test)!=NULL)
  11.  {
  12.  puts(str);
  13.  }
  14.  fclose(test);
  15.  getch();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement