Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 625 Bytes

7.56.md

File metadata and controls

12 lines (8 loc) · 625 Bytes

A static class member is a member that is associated with the class, rather than with individual objects of the class type. It exists outside any object of the class.

Advantages:

  • Storage efficient.
  • If a static member of a class changes, each object of the class will use the new value of that static member.
  • A static data member can have incomplete type.
  • A static member (either a data member or a member function) can be used as a default argument.

Differences between ordinary members and static members:

  • A static member belongs to the class, an ordinary member belongs to objects of the class.