The example uses setvbuf to make stdout fully buffered. Which means it will not immediately output upon encountering a newline. The example will only display the output after the sleep (flush on exit). Without the setvbuf the output will be displayed before the sleep.

Email codedump link for How can I print a string with newline without flushing the buffer?