- 2
if you have a string that contains user String that contains first ,Second and last name construct and a new First &. last name
how i can write?
1 Answer
- 1
#include <iostream>
using namespace std;
/*If you need a function*/
string Nameconstruter(string first, string second, string last){
return (first+" "+second+" "+last);
}
int main() {string firstName ="something";
string secondName ="";
string lastName ="Last";
string all = firstName+" "+secondName+" "+lastName;
cout<<all<<endl;
cout<<Nameconstruter(firstName,secondName,lastName);
return 0;
}