Difference between printf and cprintf

What is the difference between cprintf and printf? Please explain in detail.

Questions by Ruhani Chawlia   answers by Ruhani Chawlia

Showing Answers 1 - 9 of 9 Answers

Ravindra Kittad

  • Dec 20th, 2012
 

printf outputs to the standard output stream (stdout)

fprintf goes to a file handle (FILE*)

sprintf goes to a buffer you allocated. (char*)

  Was this answer useful?  Yes

Howard Lee Harkness

  • Apr 4th, 2013
 

cprintf outputs to the console device.
fprintf outputs to a stream specified by the 1st parameter.

  Was this answer useful?  Yes

indinfer

  • Nov 16th, 2014
 

I think the original question was not a typo. The original question was printf, not fprintf, compared to cprintf. And I think printf output goes to stdout (standard out) which by default goes to con (the console). cprintf output goes only to con.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions