Question: I'm not sure why the source code is not working, so many videos show the same way, I need to print out the length of
I'm not sure why the source code is not working, so many videos show the same way, I need to print out the length of the string and the first, middle initial and last name.
#include
using std::cin; using std::string; using std::endl; using std::cout; using namespace std;
string full_name (string first, char middle, string last) { return first +" "+middle+"."+last; }
int main() { cout << "Please enter your first name, middle initial, and last name: "; string first,last; char middle; cin >> first, middle, last; cout << full_name.length() << endl; cout << full_name(first,middle,last) << endl; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
