You have to remember that output to streams (like stdout
) is by default buffered.
Nothing is written until the buffer is flushed, either explicitly by calling fflush(stdout)
or semi-explicitly by adding a newline in the the text you print (e.g printf(" hi \n");
), or implicitly by writing enough so that the buffer fills up and is flushed by the library.