How much functionality is “acceptable” for a C++ struct?

后端 未结 19 2326
礼貌的吻别
礼貌的吻别 2021-02-07 09:31

My first post so please go easy on me!

I know that there\'s no real difference between structs and classes in C++, but a lot of people including me use a struct or class

19条回答
  •  离开以前
    2021-02-07 09:54

    My personal preference is to only use structs if there's no methods at all. If I need to add a method for any reason, it's a class.

提交回复
热议问题