fprintf is used to print content in file instead of stdout console.
int fprintf(FILE *fptr, const char *str, ...);
Input: GeeksforGeeks GeeksQuiz Output: sample.txt file now having output as 0. GeeksforGeeks 1. GeeksQuiz
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
My Personal Notes arrow_drop_up
- What is the difference between printf, sprintf and fprintf?
- __builtin_inf() functions of GCC compiler
- Count substrings that contain all vowels | SET 2
- How can we use Comma operator in place of curly braces?
- Basic Code Optimizations in C
- Constants vs Variables in C language
- Sum of an array using MPI
- Difference between pointer to an array and array of pointers
- dot (.) operator in C/C++
- Features and Use of Pointers in C/C++
- Difference between while and do-while loop in C, C++, Java
- C program to sort an array using pointers
- C Program to count the Number of Characters in a File
- Analyzing BufferOverflow with GDB