Posted by eosp on 05:04:00 09-29-2003
I was using the delay() function in DJGPP, and it didn't seem to delay(1000) when I told it to stop for a second. Can someone else try it to see that it's the compiler, not me, at fault?
Code:
int main()
{
printf("Hello ");
delay(1000);
printf("world!\n");
}
_________________
C is the best programming language. Semicolon.
[ This Message was edited by: eosp on 2003-09-29 05:05 ]
[ This Message was edited by: eosp on 2003-09-29 05:05 ]
Posted by paraffin on 16:50:00 10-09-2003
try putting a fflush() call in, like this:
Code:int main()
{
printf("Hello ");
fflush();
delay(1000);
printf("world!n");
}
DJGPP takes all the liberties that buffered output offer it. It was most likely buffering the first printf statement and only displaying it after the delay.
[ This Message was edited by: paraffin on 2003-10-09 16:51 ]