What is the Difference between "printf" and "sprintf"?

Answer Posted / guest

prinf will print the data on to the screen.
sprintf will print the data to a buffer.

basically sprintf is used for formatting the output.

printf("%s",google);
char *p;
sprintf(p,"%s",google);

Is This Answer Correct ?    91 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a c++ object?

617


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

590


Explain what is polymorphism in c++?

629


Why are arrays usually processed with for loop?

775


Do the names of parameters have to agree in the prototype, definition, and call to the function?

603






Why is polymorphism useful?

569


What are destructors?

577


Which operator cannot be overloaded c++?

593


What is capacity in vector in c++?

551


What is the iunknown interface?

681


Can union be self referenced?

580


Can you Mention some Application of C/C++?

628


When is dynamic checking necessary?

604


Why is null pointer used?

686


Is it possible to use a new for the reallocation of pointers ?

601