how to print a txt file to console in c code example
Example 1: read a document in c getting name from console
#include<stdio.h>
int main(int argc,char *argv[]){
FILE *in=fopen(*++argv,"r");
char c;
while((c=fgetc(in))!=EOF)
putchar(c);
fclose(in);
return 0;
}
Example 2: how to print a file c
c = fgetc(fptr);
while (c != EOF)
{
printf ("%c", c);
c = fgetc(fptr);
}