In C++, When a static variable is declared inside a class it is known as class variable. This static variable is shared among all the objects of that class. If a programmer want to track the number of objects of a particular class in the system, such variables helps.
It's a long time back when I studied so I could not provide much details.
Looking for others to respond.