Writes output to a specified character array under format control.
#include <stdio.h> int sprintf ( char *str, const char *format, ... );
(OUT) Points to the character array into which to place the output.
(IN) Points to the format control string. See Print Format Control Strings.
(IN) Points to an argument for a conversion specifier. The number of arguments is determined by the format string.
If successful, returns the number of characters written into the array, not counting the null-terminating character. Otherwise, returns a negative value and sets errno to one of the following:
The sprintf function is equivalent to fprintf, except that the str parameter specifies a character array into which the generated output is placed, rather than to a file. A null-terminating character is placed at the end of the generated character string.