Advertisement
ProToTN

Display a program's lines

Feb 12th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5.  
  6. void displayProg(FILE * file)
  7. {
  8.     char CH[254];
  9.     file = fopen("main.c","r");
  10.     while(feof(file) == 0)
  11.     {
  12.         fgets(CH,254,file);
  13.         printf("%s\n",CH);
  14.     }
  15. }
  16.  
  17.  
  18. void main()
  19. {
  20.     FILE * file;
  21.     displayProg(file);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement