ExplanationIn the above example file is opened in read and write mode (r +). The ge tc () function
reads the contents of file which is printed through printf () function. The getche () function reads
character from the keyboard and the read characters are written to file using f putc () function.
B Binary Modes
1. wb (write) This mode opens a binary file in write mode.
Example
fp= fopen ("data.dat","wb");
Here, data. dat file is opened in binary mode for writing.
2. rb (read) This mode opens a binary file in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.