You can use the members the sprintf()
-family of functions to convert "something" to a "string".
#define _POSIX_C_SOURCE 200112L
#include <stdio.h>
#include <unistd.h>
#include <string.h>
int main(void)
{
size_t s = 123456789;
char str[256] = ""; /* In fact not necessary as snprintf() adds the
0-terminator. */
snprintf(str, sizeof str, "%zu", s);
fputs(stdout, "The size is '");
fflush(stdout);
write(fileno(stdout), str, strlen(str));
fputs(stdout, "'.\n");
return 0;
}
Prints out:
The size is '123456789'.