Print formatted data to a string.
int sprintf (char * string, char * format [, arguments]...);
Required Header |
<stdio.h> |
Return Value
This function returns the number of characters printed to the string. -1 indicates an error.
Parameters
string
A pointer to the string result
format
The format control string
arguments
Optional arguments
Remarks
The sprintf function prints formatted data to the string based on the same rules of the printf function, using the optional arguments as specified by the format string.
See Also fprintf, fread, fscanf, fwrite, printf, _snprintf, vsprintf