#include 
/* CS245 - CS II SPRING 1997 LAB 2 - written by Wayne Summers

Write a program that

   1.reads in two strings of arbitrary length, 
   2.write out each of the strings, 
	3.concatenate(string equivalent of add) the two strings and print the result
*/

int main()
{
	char* str1;
	char* str2;
	char* combined;

	str1 = new char;
	str2 = new char;

	cout << "\nEnter string 1: ";
	cin >> str1;
	cout << str1;
	cout << "\nEnter string 2: ";
	cin >> str2;
	cout << str2;

	combined = new char[strln(str1) + strln(str2) + 1];

// copy str1 to combined
	for (int count = 0; str1[count] != '\0'; count++)
		combined[count] = str1[count];

// concatenate str2 to combined
	for (int count2 = 0; str2[count2] != '\0'; count2++, count++)
		combined[count] = str2[count2];

	combined[count] = '\0';

	cout << "\ncombined string is: ";
	cout << combined;
}