Message-Id: <515C083001E72A00@iris.ernet.in> Date: 04 Nov 96 18:45 IST From: tehmul%NIITPUN AT iris DOT ernet DOT in Sender: tehmul%niitpun AT iris DOT ernet DOT in To: djgpp AT delorie DOT com Subject: Re: Using getch() in DJGPP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit bitc wrote: >> >> Why doesn't the following function in DJGPP... >> int main() >> { >> printf("Hello."); >> getch(); >> } >> [snip] when compiled under DJGPP, I get this: >> {keypress}Hello. {exit} >> > AFAIK it's because stdout is buffered. Turn out buffering of stdout and it > should work fine (But I can't remember how to do it).. I think you got to use setvbuf or setbuf. I forgot myself. But you could always do this instead. printf( "Hello." ); fflush( stdout ); getch(); Incidentally, if you'd used an stdio function like say, getchar(); to pause for input, it would have remembered to send pending output to the screen. TG