Skip to content

Static member

Top Post on IndiBlogger

6
  • Aditya Narayan Mohanty
  • Vinay Nagaraju
  • Amit Misra
  • Veidehi Gite
Static member

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


Popular Articles by this blogger