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 ifstream c++?

779


How do you invoke a base member function from a derived class in which you’ve overridden that function?

773


What are protected members in c++?

832


Which should be more useful: the protected and public virtuals?

756


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

785






Why do we use iterators?

802


What is doubly linked list in c++?

813


Evaulate: 22%5 a) 2 b) 4 c) 0

846


What is the role of C++ shorthand's?

950


What is function overloading in C++?

1058


What's the best free c++ profiler for windows?

809


Can we distribute function templates and class templates in object libraries?

776


What apps are written in c++?

785


What is new in c++?

837


Explain what are single and multiple inheritances in c++?

724