c++ change function's variable argument

后端 未结 2 1961
小鲜肉
小鲜肉 2020-12-07 03:59

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         


        
2条回答
  •  庸人自扰
    2020-12-07 04:09

    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.

提交回复
热议问题