I have a homework assignment I'm having a bit of trouble with. I seem to have no errors, but when I run the program and input text....nothing happens.
For example, to test it I usually put in "Robertson, Bob John" and hit enter. Can anyone help me with this?
#include <iostream>
#include <string>
using namespace std;
int main () {
//Title and instructions
cout << "This program will output your name in first-to-last order!" << endl;
cout << "Please type your name in the following manner: last, first middle."; << endl;
//Declare the strings being used
string firstName;
string middleName;
string lastName;
//Put user input into strings, ignore the comma
cin >> lastName >> firstName >> middleName >> endl;
cin.ignore(',');
//Output the name in first-to-last order
cout << "Your name is: " << first <<' '<< middle <<' '<< last << endl;
//Pause before exiting
return 0;
}
//Pause before exiting return 0;- this is not a pause, but return code.