Skip to content
This repository was archived by the owner on May 28, 2026. It is now read-only.

Latest commit

 

History

History
23 lines (20 loc) · 1.01 KB

File metadata and controls

23 lines (20 loc) · 1.01 KB

What is the Difference Between class and struct?

The keywords class and struct both declare a so-called class type. The declared class will have different properties, such as default member access, depending on whether class or struct was used.

class

?inline

  • members private by default
  • private inheritance from base class by default
  • incompatible with C
  • typically used for larger classes

struct

?inline