+ 1
when does a static value change in c++?
static value
3 odpowiedzi
+ 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
+ 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.
- 2
hey