2080 5

Object Oriented Programming20805 marksStatic members

Write a C++ program to display the number of objects created using static member.

Write a C++ program to display the number of objects created using static member. [5]

A static data member is shared by all objects of a class. It is initialized only once and retains its value throughout the program. It is used here to count how many objects have been created, because every time a constructor is called (i.e., an object is created), the static counter is increment...

Up nextExplain about friend function and friend class with an example.