Hi. Love to help but I have no idea what your question is
Thanks for your reply. For some reason, I have edited my question, but it did not up-date. Sorry.
here is what I am trying to accomplish:
#include <iostream>
#include <string>
using namespace std;
const string name = "John Paul Jones";
int main() {
int spacePos = name.find(' ');
string firstName = name.substr(0, spacePos);
string middleName = name.substr(spacePos + 1);
cout << firstName + ' ' << middleName << endl;
return 0;
}
My goal is to be able to show first any name that is type above the int "string const <name>= "..."
As an example, I have firstname= John, middlename = Paul and lastname = Jones.
However, the problem is that I really do not know how to go about this. So far, I have been able to obtain the first name correctly. When I request the middlename, it actually provides me both: middlename, and lastname.
Thanks so much!!