How do I put an
int
into a string?
You can use "sprintf()" to convert integers to string and to format the output.
int sprintf(char *s, const char *format, /* args */ ... );
sprintf works like printf, however instead of sending the output to
stdout, it sends it to the string "s" in the first argument. Make sure
that "s" has enough space to store the output of sprintf.
Back to the top
This site is maintained by