When should you use a class vs a struct in C++?

后端 未结 25 1693
误落风尘
误落风尘 2020-11-22 00:18

In what scenarios is it better to use a struct vs a class in C++?

25条回答
  •  灰色年华
    2020-11-22 00:41

    I thought that Structs was intended as a Data Structure (like a multi-data type array of information) and classes was inteded for Code Packaging (like collections of subroutines & functions)..

    :(

提交回复
热议问题