Mail Archives: djgpp/1997/03/09/19:26:47
LSC wrote:
>
> #include <conio.h>
> #include <stdio.h>
>
> int main()
> {
> char keyinput;
> gotoxy(2,2);
> printf("testing");
> gotoxy(5,15);
> printf("testing 2");
> while (keyinput != 13) keyinput=getch();
> return 0;
> }
>
In DJGPP, stdio functions are buffered: the strings you write with printf
(for instance) are written into a buffer, which is output to the screen
either when the buffer is full, or when a "\n" is seen, or when you call
fflush(stdout).
To make your program behave the way you want it to, you may either
- use printf("testing\n"); (note the \n)
- use cprintf instead of printf
- call fflush(stdout) after printf() so that the contents of the printf
are dumped to the screen.
Francois
- Raw text -