Advertisement
tonygms3

displayInfo()

Mar 11th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. void displayInfo()
  2. {
  3.    FILE *file;
  4.    file = fopen("d://information.txt","r");
  5.    char eachLine[200];
  6.    if(file== NULL )
  7.    {
  8.        printf("Error Opening The required file\n\nThe Program will exit now");
  9.        exit(0);//exit function called from stdlib.h
  10.    }
  11.     while(!feof(file))
  12.     {
  13.         fgets(eachLine,200,file);
  14.         printf("%s",eachLine);
  15.     }
  16.     fclose(file);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement