C structure and C++ structure

后端 未结 6 875
挽巷
挽巷 2020-12-13 04:35

Could anybody please tell me what is the main difference between C & C++ structures.

6条回答
  •  感动是毒
    2020-12-13 04:48

    In C++, structures behave like classes, allowing methods, constructors, destructors etc...

    The main difference between classes and C++ structures is that everything inside structures is public by default, while everything inside classes is private by default. (ie: nothing outside can access them directly)

提交回复
热议问题