how should I print the contents of a file on the console in C?
I've used fprintf and fopen to write stuff to the file, but now I want to display whatever i've written in that file onto the console. How should I do that? Thanks!
- 1 decade agoFavorite Answer
the printf function will print a string to the console.
printf( string, variable)
//output is "hi"
double h = 123.45;
printf( "The value is %d \n", h);
//%d is the data format
//output is "The value is 123.45"