Getting Input from a Function - c++ [duplicate]
问题 This question already has answers here : When I change a parameter inside a function, does it change for the caller, too? (4 answers) Closed 5 years ago . I've been having a problem in c++ where I call a function which assigns some values to things, but those assignments are lost after the function has been completed. Here is my code: #include <iostream> #include <string> using namespace std; void Input(string a, string b){ cout << "Input a: \n"; cin >> a; cout << endl; cout << "Input b: \n";