Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: static member initialization (lippman's book) Message-ID: <6590260@hplsla.HP.COM> Date: 20 Sep 89 18:38:56 GMT References: <292@mez.e-technik.uni-bochum.de> Organization: HP Lake Stevens, WA Lines: 31 >ark: >It may occur only once in the entire program, >although that once may be anywere. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ***sigh***, if this statement were only true! See below: #include class Y; //const int Y::size = 100; 2.0 compiler won't accept it here class Y { //const int Y::size = 100; 2.0 compiler won't accept it here static const int Y::size; //const int Y::size = 100; 2.0 compiler won't accept it here int array[size]; }; const int Y::size = 100; // 2.0 compiler will accept it here, but its too late! void main() { printf("sizeof(Y)=%d\n",sizeof(Y)); }