#include #include using namespace std; char* concatenate_strings(const char *start, const char *end){ size_t final_length = strlen(start) + strlen(end); char *new_string = new char[final_length + 1]; strcpy(new_string, start); strcpy(new_string + strlen(start), end); return new_string; } int main(){ char *a = "ant", *b = "bee"; char *c = concatenate_strings(a, b); cout << c << endl; char *d = concatenate_strings("dog", "moose"); if(c == d) cout << "c and d are equal" << endl; cout << d << endl; cout << "c is " << c << endl; delete [] c; delete [] d; return 0; }