whit@granite:~/public_html/cpsc146/Samples[?1034h[whit@granite Samples]$ cat strings.cpp
#include
#include
using namespace std;
int main()
{
string str1, str2, str3;
cout <<"\nEnter the first string: ";
getline(cin, str1);
cout << "ENter the second string: ";
getline(cin, str2);
cout << "\n\n";
str3 = str1 + str2 ;
cout << "The length of first string : " << str1.length() << endl;
cout << "The first string + the second is: " << str3 << endl;
return 0;
}
whit@granite:~/public_html/cpsc146/Samples[whit@granite Samples]$ ./a.out
Enter the first string: ketchup
ENter the second string: bottle
The length of first string : 7
The first string + the second is: ketchupbottle
whit@granite:~/public_html/cpsc146/Samples[whit@granite Samples]$ ./a.out
Enter the first string: Hi, my name is Cleveland
ENter the second string: Browns
The length of first string : 24
The first string + the second is: Hi, my name is ClevelandBrowns