(string Concatenation) Write a program that separately inputs a first name and a last name and concatenates the two into a new string.
What will be an ideal response?
```
// Program reads a first name and last name and concatenates the two.
#include
#include
using namespace std;
int main()
{
// declare two strings
string first;
string last;
cout << "Enter first name: ";
cin >> first;
cout << "Enter last name: ";
cin >> last;
// use function append to insert space and string last
first.append( " " ).append( last );
cout << "The full name is: " << first << endl;
} // end main
```
Enter first name: John
Enter last name: Green
The full name is: John Green
You might also like to view...
Packet filter firewalls operate at which of the following layers of the OSI model?
a. Application b. Network c. Session d. Transport
Using an open wireless network to access the Internet without permission is called
Indicate whether the statement is true or false