From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: char getch(void) Date: Tue, 13 Jan 1998 19:22:15 -0800 Organization: Alcyone Systems Lines: 37 Message-ID: <34BC2F67.7799C508@alcyone.com> References: <34bbe72b DOT 4606230 AT news2 DOT frankfurt DOT netsurf DOT de> NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Bjoern Appel wrote: > #include > #include > > 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)