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 std :: endl?

792


what are the iterator and generic algorithms.

1723


What is namespace std; and what is consists of?

940


Can we sort map in c++?

791


What is the difference between struct and class?

1054


What is name hiding in c++?

876


What is null and void pointer?

805


How new/delete differs from malloc()/free?

866


What is the difference between a type-specific template friend class and a general template friend class?

767


Can we delete this pointer in c++?

951


Explain what data encapsulation is in c++?

794


Discussion on error handling of C++ .

856


What is the use of function pointer?

761


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

863


Keyword mean in declaration?

803