sends formatted output to a string pointed to, by str
xxxxxxxxxx
#include <stdio.h>
int main() {
char str[32];
int i = 123;
double d = 4.56;
sprintf(str, "int: %d, double: %f", i, d); // str will be "int: 123, double: 4.560000"
printf("%s\n", str);
}