what is the diff between the printf and sprintf functions??
and what is the syntax for this two functions ??

Answer Posted / vignesh1988i

the printf and sprintf functions are used to output to the
screen.....
in printf... just we can print the necessary things as
we wanted
SYNTX is:: printf("format specifiers..(%d or %c
etc)",list of agruments..(arg1,arg2... arg n);
hrewr this function directly output whatever you are giving
inside ....
but sprintf is called Stream printf... where it will store
whatever we output to the screen in an array (ie..stream)
and then output to the screen;;;

sprintf(array base address,"format specifications",variables);

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Should I learn c before c++?

613


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1477


What is wrong with this code?

695


any "C" function by default returns an a) int value b) float value c) char value d) a & b

665


When we use void main and int main?

588






Define VARIABLE?

690


What is n in c?

575


What is a scope resolution operator in c?

751


What is volatile c?

525


Explain what standard functions are available to manipulate strings?

613


What is new line escape sequence?

810


What do you mean by command line argument?

644


What extern c means?

540


I have seen function declarations that look like this

602


What is function prototype in c language?

617