0
4 Respuestas
+ 2
0
can you explain the sprintf?
0
Sajad Rahmanian sprintf is similar to printf, but puts the output in a string instead of putting it on the terminal. We want the string to be "%ns", where the n is a decimal formated variable. As you probably know, printf uses %% to print a literal % and %d to print a decimal integer so we use sprintf(str, "%%%ds", n). If, for example n is 12, then str will be "%12s",and we can feed that to scanf to scan for a string of at most 12 characters.
0
got it..thank you