ExplanationIn the above program the file is opened in read only mode. The read () declaration
within the while loop reads single character from the file destined by the file handler s. Theputch
() statement following the read () declaration shows the read character on the console. The
while loop ends when the end of file is detected.
d. Setting BufferThe size of buffer can be set using setbuf () function. This function is defined
in "stdio. h/f. The syntax of setbuf () is as follows.
Syntaxvoid setbuf( FILE *fp, char *b
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.