Writes output to a specified character array under format control.
#include <stdio.h> int snprintf ( char *str, size_t n, const char *format, ... );
(OUT) Points to the character array into which to place the output.
(IN) Specifies the number of characters to generate for the str parameter. Output beyond n-1 is discarded, and the array in str is null terminated.
(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 snprintf function is equivalent to sprintf, except that the n parameter specifies the number of characters to generated for output. A null-terminating character is placed at the end of the generated character string.