Struct inheritance in C++

后端 未结 6 665
情书的邮戳
情书的邮戳 2020-12-02 05:28

Can a struct be inherited in C++?

6条回答
  •  孤街浪徒
    2020-12-02 05:51

    Other than what Alex and Evan have already stated, I would like to add that a C++ struct is not like a C struct.

    In C++, a struct can have methods, inheritance, etc. just like a C++ class.

提交回复
热议问题