i want to change my variable passed as argument to this function:
bool verifyStudent(string id, string name, int grade, int points, string type) {
if(!verify
Quote:
Therefore, C++ has two parameter passing mechanisms, call by value (as in Java) and call by reference. When a parameter is passed by reference, the function can modify the original. Call by reference is indcated by an & behind the parameter type.
Here is a typical function that takes advantage of call by reference [...]
void swap(int& a, int& b) { [...] }
More here -> A3.5. Functions
In order to change the arguments, you would have to take references:
bool verifyStudent(string& id, string& name, int& grade, int& points, string& type)
Although I'd say that function is not verifyStudent as much as verifyAndCorrectStudentIfNeeded.