asprintf is not 100% standard, but it's available via the GNU and BSD standard C libraries, so you probably have it. It allocates the output, so you don't have to sit there and count characters.
char *hi="Hello";
char *ext = ".txt";
char *cat;
asprintf(&cat, "%s%s", hi, ext);