Answer to Question #70380 in C++ for Andy

Question #70380
How are static variables that are data members of a class initialised??
1
Expert's answer
2017-10-03T15:03:07-0400
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);

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS