Mail Archives: djgpp/1996/10/27/09:33:59
bitc wrote:
>
> Why doesn't the following function in DJGPP...
>
> int main()
> {
> printf("Hello.");
> getch();
> }
>
> Now, in every other compiler I've seen, the binary will run like this:
>
> Hello. {keypress}{exit}
>
> But when compiled under DJGPP, I get this:
>
> {keypress}Hello. {exit}
>
> This isn't making sense to me. Why isn't the string printing until I press
> a key? Shouldn't the program run in the order I wrote the instructions?
>
> Jake Harvey
> jwharvey AT interaccess DOT com
>
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)..
--
-------------------------------------------------------------------------------
Blessed be, Moon Shade.
An ye harm none, do what ye will.
Hope never dies.
-------------------------------------------------------------------------------
- Raw text -