Mail Archives: djgpp/1998/01/27/00:01:20
In article <19980127005001 DOT TAA19938 AT ladder01 DOT news DOT aol DOT com>, qballlives AT aol DOT com
(QBallLives) writes:
>I believe that's a buffering issue... but I'm too tired to think of the
>command
>to use to clear that buffer out... my friend dhonn has keyboard
>routines code
>that I believe does the flush you need done...
>his page:
If it is a buffering issue, as in the classic...
#include <stdio.h>
#include <conio.h>
int main()
{
printf("foo");
getch(); /* waits for a key, no "foo'' visible to user */
return 0; /* "foo" comes only when the program exits */
/* and buffer is flushed */
}
...then (this is a long sentence!) you could use cprintf(), which is a
non-buffered function in conio.h, instead of printf(), or you could use this:
fflush(stdout); /* flushes the buffer to stdout */
...before you call printf().
--Ed (Myknees)
- Raw text -