2. static #

Created Saturday 11 January 2020

Here, we’ll study about use of static w.r.t OOP in C++ . When we declare a member of a class as static it means no matter how many objects of the class are created, there is only one copy of the static member.

Static Data Members #

inline static int x = 2;

Complete vs Incomplete declaration.

Static Member Functions #

MyClass::f(); // f is a static member function