sprintf function — Writes formatted data to a string
int sprintf(char* s, const char* format, ...)
The sprintf
function is
like fprintf
, but instead of
writing to an open file, it "writes" by copying characters to the
string s
. See fprintf
for a description of the format
parameter.
You must ensure that s
is
large enough for the formatted string. For some formats, this is
impossible, which makes sprintf
unsafe to use.