#: 8702 S3/Languages
13-Dec-90 03:46:49
Sb: #C and buffers
Fm: Dan Charrois 70721,1506
To: all
I have a question about buffers and C that has no doubt been asked before, and
I apologize for that. But anyways, given the following code: main()
{
printf("First line");
sleep(1);
Circle(1,100);
sleep(1);
} Why does the system sleep for 1 Second, draw the Circle, sleep another
second, and THEN print "First line" right before exiting? I gather that it
must have something to do with buffered output since if I tack a \n after
'line' things work as expected, but how can I get the code above to work the
way it would intuitively seem to? I noticed that I could use write and it
worked alright (perhaps), except I still wouldn't know how to print formatted
output this way.
I'd appreciate hearing from anyone who has even the slightest idea on what
exactly is going on.
Dan
There are 2 Replies.
|