I understand what functions like setbuf do (set block buffering, line buffer, or no buffering). But what is the purpose for change the type of buffering used by a stream? Under what circumstances would you change the buffering type, and why?
Printable View
I understand what functions like setbuf do (set block buffering, line buffer, or no buffering). But what is the purpose for change the type of buffering used by a stream? Under what circumstances would you change the buffering type, and why?
You might want to disable buffering to get keypresses immediately.
Maybe your program reads in thousands of files that are three characters larger than the buffer size: it would be more efficient to change the buffer size to three characters larger.
That makes sense. Thanks