Mail Archives: djgpp/1998/09/27/15:15:13
Destination: user AT ts001d22 DOT cin-oh DOT concentric DOT net (Test User)
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: 27 Sep 1998 04:10:07 PDT:
>When compiled with DJGPP, the program just sits there until
>the user types something and presses ENTER. Then, the
>program spews out the Input: prompt and the string the
>user typed at the same time. For some reason, it executes
>fgets() first, and then executes both printf's together. You
>can't get it to print the prompt first, then call fgets(),
>and then print the results. You can substitute fgets() for
>your own elaborate loop system. You'll get the same result.
It behaves exactly as it should. Standard I/O is buffered and usually
triggered when a '\n' character appears. You can either issue a fflush(stdout)
after the prompt or add a newline after "Input".
--
Bye,
Gerhard
email: sparhawk AT eunet DOT at
g DOT gruber AT sis DOT co DOT at
Spelling corrections are appreciated.
ICQ#: 18578771
- Raw text -