Mail Archives: djgpp/1997/02/18/01:54:01
[posted and emailed]
Enemy Mindz (mceeras AT akula DOT com) wrote:
: printf("Which character is greater?");
: printf("\nType a single character:");
: a=getche();
: printf("\nType another character:");
: b=getche();
The output from printf is line-buffered; nothing is printed until you send
a '\n' character. So, when it gets to 'a=getche();', the prompt is still in
the buffer, not on the screen. If you call the function fflush(stdout);
before each getche(), it should work as you expected.
: Can someone help? Thank you.. If you can help please e-mail me at
: mceeras AT akula DOT com
Okay, but I strongly suggest that you subscribe to the newsgroup / mailing
list; your questions may have been answered before (this one comes up farily
often, in fact).
--
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.
- Raw text -