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

Is string an object in c++?

893


What size is allocated to the union variable?

817


What is a binary file? List the merits and demerits of the binary file usagein C++.

979


What are abstract data types in c++?

774


What is #include cmath?

856


What is the use of c++ programming language in real life?

794


Why is c++ called oops?

822


Define a constructor - what it is and how it might be called (2 methods)?

830


What is a modifier in c++?

872


What is array give example?

798


Can member data be public?

792


Mention the ways in which parameterized can be invoked.

743


What are the advantages of using typedef in a program?

881


What is ios in c++?

946


What is the maximum combined length of command line arguments including the space between adjacent arguments?

801