0

What is static data member??

17th Nov 2016, 4:26 AM
Arun Vishwakarma
Arun Vishwakarma - avatar
2 Réponses
+ 1
A static member is shared by all objects of the class. All static data is initialized to zero when the first object is created, if no other initialization is present. We can't put it in the class definition but it can be initialized outside the class as done in the following example by redeclaring the static variable, using the scope resolution operator :: to identify which class it belongs to.
17th Nov 2016, 7:30 AM
ROHAN JOSHI
ROHAN JOSHI - avatar
0
ok
17th Nov 2016, 8:22 AM
Arun Vishwakarma
Arun Vishwakarma - avatar