Message-ID: <37252B2E.2C928964@unb.ca> Date: Tue, 27 Apr 1999 00:12:47 -0300 From: Endlisnis X-Mailer: Mozilla 4.04 [en] (Win95; U) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com Subject: Re: Help References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Info: BrunNet, Inc. 888-278-6638 Reply-To: djgpp AT delorie DOT com Paul A Jimenez wrote: > I don't know if this is a complier bug or just a mistake that I am not catching. > ------------------------------------------------------------------------------ > #include > #include > > class stack > { > public: > static int stack_count ; > public: > > static int get_count(void) > { > return(stack_count); > } > stack() > { > ++stack_count; > } > }; int stack::stack_count; //It needs to set aside space for the variable. > main() > { > stack a_stack; > stack b_stack; > stack c_stack; > > clrscr(); > > cout << stack::get_count; > } That compiles and runs, but it output's "1" when I run it. I would have expected it to output "3". Can anyone explain it? -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT BrunNet DOT Net Endlisnis AT HotMail DOT com ICQ: 32959047 (Once upon a time there was light in my life) (But now there's only _______________ ???)