Mail Archives: djgpp-workers/1999/05/09/07:00:56
Dear Eli Zaretskii,
On 05-09-99 at 05:30:02 EST you wrote:
>
>
> Given the forwarded message, should we add fflush(stdout+stderr) to
> `getch', like we already did in `filbuf'? Or would programs that use
> `getch' hate us for flushing the streams for every input character?
>
Heaven forbid!
As nearly as I can determine, the performance of the output utility
is the intended one.
> #include <conio.h>
> #include <iostream.h>
>
> int main() {
> clrscr();
> cout << "Hello World\n";
> cout << "Sing along!";
> getch();
> return 0;
> }
The second line wasn't flushed by the output utility because it wasn't
a complete line. If user wants a line printed before a call to getch(),
said user should issue a `fflush()' beforehand. The thought that every
call to getch() would be preceded by automatic calls to fflush(stdout)
and fflush(stderr) is chilling indeed.
K.B. Williams
- Raw text -