Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!emory!att!linac!mgweed!prg From: prg@mgweed.UUCP (Gunsul) Newsgroups: comp.lang.c Subject: Re: It's unexplainable... Summary: Buffered output... Message-ID: <8412@mgweed.UUCP> Date: 30 Jan 91 21:51:53 GMT References: <1991Jan30.203605.14481@bronze.ucs.indiana.edu> Organization: AT&T Montgomery Works, Montgomery, IL Lines: 28 In article <1991Jan30.203605.14481@bronze.ucs.indiana.edu>, speelmo@bronze.ucs.indiana.edu (Lance Speelmon - UCS) writes: | Would anyone please explain to me why my output is not what I am | expecting... Here is a script of my source and the output... | | Thanks, | Lance | ----------------------------------------------------- | | #include | | void main(void){ | printf("The date is: "); | system("date"); | printf("\n"); | } | ============================================================================== | | Lance Speelmon | University Computing Services | | | speelmo@bronze.ucs.indiana.edu | Network Operations Center | | ============================================================================== Lance, just before your printf statement, insert this line: setbuf(stdout, 0); I think you'll be pleased with the results.. You might want to RTFM on setbuf after you see the results. Many people have been had by this one! Phil