It's unexplainable...

Gunsul prg at mgweed.UUCP
Thu Jan 31 08:51:53 AEST 1991


In article <1991Jan30.203605.14481 at bronze.ucs.indiana.edu>, speelmo at 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 <stdio.h>
| 
| void main(void){
|   printf("The date is: ");
|   system("date");
|   printf("\n");
| }
| ==============================================================================
| | Lance Speelmon                      |  University Computing Services       |
| | speelmo at 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



More information about the Comp.lang.c mailing list