I am currently running a piece of C code on my Raspberry Pi computer. It is a random number generator that reads from a Geiger counter connected to GPIO digital input 18. It mak
By default, output on stdout
is line-buffered when it's writing to a terminal. This means that the output will be held in memory until you print a newline or call fflush(stdout)
(or the output buffer fills up -- that's typically 4K or 8K characters).
So put fflush(stdout)
at the places where you want the accumulated output to be displayed. Or use setbuf(stdout, NULL)
to disable buffering entirely.