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 are the advantages of using pointers in a program?

650


What is command line arguments in C++? What are its uses? Where we have to use this?

552


Will rust take over c++?

566


Define a pdb file.

615


What is meant by the term name mangling in c++?

498






What is the difference between prefix and postfix versions of operator++()?

569


Explain the difference between c++ and java.

604


What are the manipulators in c++?

528


Are php strings immutable?

535


What is function prototyping? What are its advantages?

571


Why is c++ not purely object oriented?

536


Explain about Virtual Function in C++?

588


What is the use of ::(scope resolution operator)?

628


How to access a variable of the structure?

563


Explain rethrowing exceptions with an example?

580