TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: all
from: Dan Charrois 70721,1506
date: 1990-12-13 03:46:49
subject: #C and buffers

#: 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.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.