C++ - class issue

前端 未结 6 1627
灰色年华
灰色年华 2021-01-24 19:33

At: http://www.learncpp.com/cpp-tutorial/82-classes-and-class-members/

There is the following program (I made some small modifications):

#include 

        
6条回答
  •  孤街浪徒
    2021-01-24 19:45

    You'll have to include the header that declares the strncpy function. So add

    #include  
    

    at the beginning.

    And the member name is m_wage but you've used it as wage in your print member function.

    Change

    std::cout<<"Name: "<

    to

    std::cout<<"Name: "<

提交回复
热议问题