fprintf() in C
fprintf is used to print content in file instead of stdout console.
int fprintf(FILE *fptr, const char *str, ...);
(fptr == NULL)
"Could not open file"
(i = 0; i < n; i++)
"Enter a name"
, i, str);
Output: sample.txt file now having output as
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.