cannot call member function without object

后端 未结 4 1666
遥遥无期
遥遥无期 2020-11-27 19:09

This program has the user input name/age pairs and then outputs them, using a class. Here is the code.

#include \"std_lib_facilitie         


        
4条回答
  •  天命终不由人
    2020-11-27 19:31

    You are right - you declared a new use defined type (Name_pairs) and you need variable of that type to use it.

    The code should go like this:

    Name_pairs np;
    np.read_names()
    

提交回复
热议问题