Created
June 16, 2020 10:10
-
-
Save 2hanX/ae5c0e5db110f219530503bf397ca692 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
using namespace std; | |
struct person | |
{ | |
string fname; | |
string lname; | |
}; | |
int main() | |
{ | |
person p; | |
string name; | |
cout << "Enter your first name: "; | |
getline(cin, p.fname); | |
cout << "Enter your last name: "; | |
getline(cin, p.lname); | |
name = p.lname + ", " + p.fname; | |
cout << "Here's the information in a single string: " << name << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment