Is there an API to convert a character to a string in C?
I basically have a string and want to insert a character at the end of it. Say,
char str[] = "hello";
I want it to look like "hello1";
I am looking for a convenient API instead of something complicated like
#include <stdio.h>
#include <string.h>
int main(void)
{
char str[] = "hello";
int len = strlen(str);
/*assume this is the character I want to add at the end */
str[len] = '1';
str[len+1] = NULL;
printf("%s",str);
return 0;
}