2080 5

CSC166 ยท 2080 ยท 5 marks

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]

Object Oriented ProgrammingChapter 3: Classes & ObjectsStatic members

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...