Hi I have a problem with this program.
I am not sure what to do. Do I need to convert them to a char array and then use one as input and the other as out put. Any input on this would be great I am stuck with this one.Code:#include <iostream> #include <string> using namespace std; void welcomeMessage(); string user_information ( string name1, string name2); void exitMessage ( string name1, string name2); int main() { string firstname, lastname; welcomeMessage(); user_information ( firstname, lastname ); exitMessage ( firstname, lastname ); system("PAUSE"); return 0; } void welcomeMessage() { cout << "Welcome to my C++ program \n"; } string user_information ( string name1, string name2) { cout << "Please give me your first name "; cin >> name1; cout << "Please give me your last name "; cin >> name2; return name1 ; } void exitMessage ( string name1, string name2) { cout << "Thank you "; cout << name1; cout << " "; cout << name2 << endl; cout << "for using my project " << endl; }



LinkBack URL
About LinkBacks



