header file: stdio.h
int snprintf(char *restrict buffer, size_t count, const char *restrict format, ...);
header file: stdio.h
int _snprintf(char *buffer, size_t count, const char *format [, argument] ...);
This function prints formatted data to a string..
The Windows and Unix versions of this function differ only in
name and the needed header file; changing the name should be all
that is required to port between the two operating systems.
There are several functions that print formatted text, based on
various needs. Additionally, it is recommended to use the more
secure versions, as detailed in this MSDN article.
Example of Use in Windows
For a complete example, see the linked MSDN article.