Question #70380

How are static variables that are data members of a class initialised??

Expert's answer

In C++, static member variables are initialised to zero once first object of class is created; There is only one instance of this variable for any number of objects of this class; Static variables can't be initialised inside class but they can be initialised outside of class accoding to the format:
(data type of varible) (name of class)::(name of varible)= (value);
LATEST TUTORIALS
APPROVED BY CLIENTS