Question 12.4

My program's prompts and intermediate output don't always show up on the screen, especially when I pipe the output through another program.


It's best to use an explicit fflush(stdout) whenever output should definitely be visible. Several mechanisms attempt to perform the fflush for you, at the ``right time,'' but they tend to apply only when stdout is an interactive terminal. (See also question 12.24.)

References: ANSI Sec. 4.9.5.2
ISO Sec. 7.9.5.2


Read sequentially: prev next up top


This page by Steve Summit // Copyright 1995 // mail feedback