How do you write the concatenate the strings using pointer?

Answer:
char* s1 = "This is a string";
char* s2 = " and this is to be concatenated";
char* s3 = new char [strlen(s1) + strlen(s2) + 1];
if (s3 == NULL) {... handle memory failure exception ...}
strcpy (s3, s1);
strcat (s3, s2);
cout << s3 << endl;
delete [] s3;
First answer by Alex146. Last edit by Alex146. Contributor trust: 419 [recommend contributor recommended]. Question popularity: 1 [recommend question].