Advertisement
Sufyan

Display Content of file

May 29th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.26 KB | None | 0 0
  1. /* Program to display the contents of a file on screen ...lol*/
  2. #include <stdio.h>
  3. void main()
  4. {
  5.    FILE *fopen(), *fp;
  6.    int c;
  7.    fp = fopen("prog.c","r");
  8.    c = getc(fp) ;
  9.    while (c!= EOF)
  10.    {
  11.         putchar(c);
  12.         c = getc(fp);
  13.    }
  14.    fclose(fp);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement