#include #include #include char* double_string(char* original){ size_t len = strlen(original); char *new_string = malloc(len * 2 + 1); char *a = new_string; char *b = original; while(*a++ = *b++); a = new_string + len; b = original; while(*a++ = *b++); return new_string; } int main(){ char *long_string = double_string("fox"); puts(long_string); free(long_string); return 0; }