snprintf - print formatted text to string
Standard C Library (libc, -lc)
#include <unistd.h>
int
snprintf(char *buf, size_t buflen,
const char *format, ...);
int
vsnprintf(char *buf, size_t buflen,
const char *format, va_list);
snprintf performs printf-style formatting on the string format and subsequent arguments. The resulting string is placed in buf, which is a memory area at least buflen bytes long. A null terminator is always added to buf; the space for this is presumed to be counted in buflen.
vsnprintf is the same as snprintf, except that the subsequent arguments are presumed to have already been collected using the stdarg facility.
snprintf and vsnprintf return the number of characters printed.