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
Can malloc be used in c++?
What is endl c++?
In what situations do you have to use initialization list rather than assignment in constructors?
What is a pointer with example?
What are the advantage of using register variables?
Explain what are the sizes and ranges of the basic c++ data types?
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
Is it possible for a member function to delete the pointer, named this?
Do you know what are pure virtual functions?
What is the auto keyword good for in c++?
What is problem with overriding functions?
Which programming language should I learn first?
What is virtual base class uses?
What is meant by const_cast?
What c++ library is string in?