
questions about sprintf, sscanf, printf, scanf, fscanf, fprintf!
I don't all off you question but I give it a try.
Quote:
> Hello everybody!
> Sometimes, read some words in this newsgroup,
> someone said that use sprintf or sscanf instead of printf or scanf!
> why?
sprintf? Are you sure I think you are talking of fgets instead of gets.
sprintf does not give you any output because it just write the formatted
string to it's first argument
man sprintf will tell you that.
You are well advised to use sscanf for cheking input which was read in
with fgets. The reason for that can be found in the C-FAQ (just look for
scanf and why it is unwise to use)
Quote:
> and, I recently find Paul, use a statment:
> fprintf("Text here",stdout);
Maybe Paul want to show the usage off fprintf and fprintf is a to use to
write to stderr. printf write just to standard output, but if s.th goes
wrong you normally did not want to clutter normal output and error
output together. I think it's a matter of taste. If that isn't the case
s.o else will surely correct me.
Regards
Friedrich