+ 1

when does a static value change in c++?

static value

20th Oct 2016, 2:22 PM
Lavnish
Lavnish - avatar
3 Réponses
+ 3
it changes whenevr you increment or decrement it ... or assign another value to it .. the only difference between it and another non static variable is that as far as non static variables are concerned every class has its indivisual copy .. whereas static variable will be treated as the same for all instances of the class in which it was declared ..and the chaGE in value in static variable in one class will reflect in the same varaible in another class
20th Oct 2016, 8:44 PM
CHIRANJEEV
CHIRANJEEV - avatar
+ 2
Static means that the class member is tied to the class rather than an instance to the class, and so can be used without needing to instanciate an object of the class.
20th Oct 2016, 4:25 PM
Zen
Zen - avatar
- 2
hey
20th Oct 2016, 2:57 PM
Al-Amin Hossain
Al-Amin Hossain - avatar