Mail Archives: djgpp-workers/1999/05/11/01:47:07
On Mon, 10 May 1999, Alain Magloire wrote:
> printf ("hello world\n");
> printf ("Enter key: ");
> getch();
>
> The last printf() was not flush, I did not expect it to show.
People generally expect the results be displayed in sequence. If I
would to write such a fragment, I would add a call to fflush before
getch, but too many newbies don't.
Also, I believe that if I would need the "Enter key: " prompt to
appear after getch returns, I would have switched their order in the
source instead of relying on the output to be deferred.
- Raw text -