Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int main(void)
- {
- printf("Enter the filename: ");
- char filename[30];
- scanf("%s",filename);
- printf("Trying to read %s \n",filename);
- char c = '\n';
- int i = 1;
- FILE * f = fopen(filename,"r");
- while (!feof(f))
- {
- if (c == '\n')
- printf("",i++);
- c = fgetc(f);
- putchar(c);
- }
- fclose(f);
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment