Describe use of static data member in C++ with example.
Use of static data member: 1. Static data member is used to maintain values common to the entire class. 2. It is initialized to zero when the first object of its class is created. 3. Only one copy of that member is created for the entire class and is shared by all the objects of that class.
Example:
#include<iostream.h>
#include<conio.h>
class test
{