I came across these two methods to concatenate strings:
Common part:
char* first= \"First\"; char* second = \"Second\"; char* both = malloc(strlen(fi
Neither is terribly efficient since both methods have to calculate the string length or scan it each time. Instead, since you calculate the strlen()s of the individual strings anyway, put them in variables and then just strncpy() twice.