6

When we add a static data member in class, it will have only one copy per class.Let us understand with an example.//Header file#include using namespace std;class base { static unsigned int m_classMember; //static data member unsigned int m_objectMember; //nonstatic data memberpublic:    base() {         m_objectMember = 0;        ++ m_classMember;         ++ m_objectMember;       cout &...

Read this post on allabouttechnologies.co.in


Karan Arora

blogs from Chandigarh