+ 1
What is the difference between printf and sprintf ?
2 ответов
+ 2
Hey Ravi ,
printf : output to the standard output stream
(stdout )
sprintf: goes to a buffer you allocated (char *)
printf : printf ("format", args) is used to print
the data onto the standard output
which often a computer monitor.
sprintf: sprintf(char*, "format", args) is like
printf. instead on displaying the
formated string on the standard output
i.e. a monitor, it stores the formated data in a string pointed to by the char pointer . the string location is the only difference between printf and sprintf syntax.
example for sprintf
char *p ;
sprintf (p," %s", Mock);
Hope I answered your question .
0
Got it but not fully...
Can u explain it in easy language...
It is to much technical...