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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- What is the difference between printf, sprintf and fprintf?
- C program to count frequency of each element in an array
- Brief Overview & Comparison of Object-Oriented Programming from C to Java
- Relational Database from CSV Files in C
- Bug Tracking System
- C Program to sort rows of the Matrix
- Advantages and Disadvantages of Array in C
- Types of C files after its compilation
- How to find arctangent with Examples
- Food Ordering System in C
- Difference between sizeof(int *) and sizeof(int) in C/C++
- Examination Management System in C
- Difference between Static and Dynamic Memory Allocation in C
- How does Volatile qualifier of C works in Computing System
Improved By : subhankarh701