Mail Archives: djgpp/1996/10/27/10:11:56
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
DJGPP is a DOS port of the GNU C compiler that has roots in the
Unix domain. Here, output to stdio will not be printed before a
newline character is sent. The program
int main() { printf("Hello.\n"); getch(); }
should produce the sequence you expected.
Mikkel
- Raw text -