CR> class A {
CR> private:
CR> int array[100];
CR> };
Is there a way to make the private members static in the class itself, even
if an objected has automatic (dynamic) duration?
CR> int main(void)
CR> {
CR> A b[50]; // The array b has dynamic duration since it is defined
CR> // inside a function body and is not typed static. The
CR> } // space for 50 * sizeof(array[]) is reserved on the stack.
So this object's private members are NOT on the stack:
int main(void)
{
static A b[50];
}
--- Maximus/2 3.01
---------------
* Origin: CYBERSPACE/2 þ Kingston, Ont þ 14.4 & 33.6 (1:249/117) (1:249/119)
|