Ask your own question, for FREE!
Mathematics 19 Online
OpenStudy (anonymous):

What is the difference between printf(), sprintf(), and fprintf()?

OpenStudy (anonymous):

also, what value do those functions return?

OpenStudy (anonymous):

they don't return anything

OpenStudy (anonymous):

They just print text

OpenStudy (anonymous):

printf is the normal one

OpenStudy (anonymous):

fprintf is printing to files I think (it's been a whole year nsince I did computing).

OpenStudy (anonymous):

printf does have a return value of type int.

OpenStudy (anonymous):

and i'm guessing sprintf scans a value from the user and prints it immediately.

OpenStudy (anonymous):

they are just guesses.

OpenStudy (anonymous):

printf() returns integer which is number of bytes printed in the output buffer. sprintf() takes two parameter, returns integer which is number of bytes printed in the input string fprintf() is like printf but prints thing in file.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!