J
john
By doing:
void MyClass::MyFunction()
{
static int myvar;
....
}
We can defined a function local variable 'myvar' that keeps its value
from call to call (the point is that the variable can not be easily
accessed from outside the function, *that* is what we want to achieve)
But this variable is global to *all* instance of the MyClass class. Is
there an artifact that allow a similar definition but for a variable
that is instance-based.
?
void MyClass::MyFunction()
{
static int myvar;
....
}
We can defined a function local variable 'myvar' that keeps its value
from call to call (the point is that the variable can not be easily
accessed from outside the function, *that* is what we want to achieve)
But this variable is global to *all* instance of the MyClass class. Is
there an artifact that allow a similar definition but for a variable
that is instance-based.
?