Mail Archives: djgpp/1998/01/13/23:02:53
Bjoern Appel wrote:
> #include<stdio.h>
> #include<conio.h>
>
> int main(void)
> {
> clrscr()
> printf("Please wait...");
> getch();
> return 0;
> }
> //end of little program **********
>
> Now the problem:
> The program shows a blank screen and will print the "Pleas wait..."
> AFTER I pushed a button, not BEFORE !!!
>
> What could I do ?
stdout is line buffered, so it will not display printed text without a
newline unless you explicitly flush it.
But there's a bigger issue, which you will invariably run into in more
unpleasant ways if you continue: conio and stdio I/O routines are not
intended to be used simultaneously (this in general holds for any I/O
manager, such as curses, etc.). Instead you should be using one or the
other. Since you want to do screen clears, you should use conio only --
use cprintf instead of printf.
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm://+37.20.07/-121.53.38
\
"Life may be / the product of imperfections."
/ (Marclo Gleiser)
- Raw text -