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

What is the acronym for ansi?

626


Why we use int main and void main?

533


What is a method in c?

622


Why is c called a structured programming language?

673


What is strcmp in c?

594






How can I handle floating-point exceptions gracefully?

632


How do I copy files?

619


What is meant by type casting?

622


What are the different types of control structures?

580


Explain how does free() know explain how much memory to release?

569


How can I manipulate strings of multibyte characters?

631


What is declaration and definition in c?

521


How would you use the functions fseek(), freed(), fwrite() and ftell()?

699


What is a volatile keyword in c?

634


What is a static function in c?

619