Why, in certain situations, does calling printf() not print the given string to the screen (stdout) until the program terminates. I ran into this with a printf() nested inside an infinite for loop; inside that for loop a child process was created, and the printf() only printed out the string when the child was terminated.
I was told to use:
fprintf(stderr, "string in here");
This did in fact work, but I want a better understanding of why the normal printf() doesn't work in this situation. I can post the code if needed.