#1) What principles govern when hello.c print_help calls printf
    vs. puts vs. fputs?
    #2) What is the difference between puts("") and printf("\n") ?

puts is for literal strings written to stdout.
fputs is for literal strings written to other streams.
printf is for formatted strings written to stdout.
(fprintf is for formatted strings written to other streams. :)

In the old days, the difference between printf("...") and puts("...")
could be noticeable, so it was good practice to use [f]puts when it was
just a literal string being output.  These days, I expect [f]printf is
optimized so it makes no difference, but I still have the habit.

Best,
Karl


Reply via email to