Quote:> The reason that you are not seeing any output is that printf()
> buffers its output until either a new line "\n" is output or you call
> fflush(stdout)
> If you change your print line to either of:
> printf("Hello World.\n");
> or
> printf("Hello World.");
> fflush(stdout);
This is true, but actually the standard requires that when a
program exit()'s, it should flush the stdio buffers. "Falling off"
the end of main constitutes an implicit call to exit() which
should result in "Hello World." being printed without a new
line. The original poster's system really is a little buggy,
as another poster pointed out. One might see what happens
if one puts in an explicit call to exit(0) or return(0) at
the end of the program.
Later, you get to learn the difference between exit() and _exit().
On a UNIX platform, you can use _exit() if you *don't* want
the stdio buffers flushed. This is sometimes useful with
fork(). Well, lots of fun toy to play with! :-)
Best wishes,
Mike