TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CLIFF RHODES
from: JASON HENDRIKS
date: 1997-03-23 19:36:00
subject: compiling dos programs

 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.