bug-hello
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In hello.c, what governs whether puts, printf, or fputs is used?


From: Bob Proulx
Subject: Re: In hello.c, what governs whether puts, printf, or fputs is used?
Date: Mon, 21 May 2007 08:45:54 -0600
User-agent: Mutt/1.5.9i

amores perros wrote:
> #1) What principles govern when hello.c print_help calls printf vs. puts 
> vs. fputs?

I think that will all be attributable to the style of the author for
those parts of the code.  It looks to me that originally the code used
a mixture of printf and fputs calls and that the calls that simply
outputed a blank line were recently changed to be a puts call instead.
It is shorter, so I imagine that is why it was done.

> #2) What is the difference between puts("") and printf("\n") ?

There isn't any effective difference.  It would simply be a matter of
style and taste.  Both call the standard I/O libc functions and libc
will end up doing the same thing in both cases.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]