Skip to content

Struct and Class

  • Structs and classes are almost identical.

  • The default access specifier and inheritance type for a struct are public, whereas those for a class are private.

  • A struct is mainly used for data-only structures.

  • A struct can fully support OOP.