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?
- Introduction to the C99 Programming Language : Part I
- Jagged Array or Array of Arrays in C with Examples
- Introduction to the C99 Programming Language : Part III
- Introduction to the C99 Programming Language : Part II
- Features of C Programming Language
- Difference between Increment and Decrement Operators
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
- Predefined Macros in C with Examples
- How to create GUI in C programming using GTK Toolkit
- ctype.h(<cctype>) library in C/C++ with Examples
- Slack Bytes in Structures : Explained with Example
- Difference between Iterators and Pointers in C/C++ with Examples