#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char firstname[20];
char name[40];
cout << "Enter your first name:";
cin.getline(firstname,20);
cout << "Enter your last name:";
cin.getline(name,40);
strcat(name,", ");
strcat(name,firstname);
cout << "Here's the information in a single string: " << name << endl;
return 0;
}
Exercise 4.3
最新推荐文章于 2022-09-15 23:17:40 发布