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

后端 未结 19 2325
礼貌的吻别
礼貌的吻别 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-07 09:55

    I use struct whenever I want to use data member as interface of the object. I'd change the struct to a class, whenever there is a need to add a private section.

提交回复
热议问题