Static Variables In a Class



 DEVELOP > c-Plus-Plus > Static Variables In a Class

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 12 Sep 2006 01:31:51 PM
Object: Static Variables In a Class
Hi all,
I was reading a book on c++. Its mentioned that static data member
initializatons should not be done in header files, but rather in .cpp
files where in we have got definitions of non-inline member functions.
I dont see any reason why we should not initialize static data members
in header files. Can anyone pls explain.
Thanks in adv.
Bharath
.

User: "Victor Bazarov"

Title: Re: Static Variables In a Class 12 Sep 2006 01:43:07 PM
wrote:

I was reading a book on c++. Its mentioned that static data member
initializatons should not be done in header files, but rather in .cpp
files where in we have got definitions of non-inline member functions.

I dont see any reason why we should not initialize static data members
in header files. Can anyone pls explain.

Please read the "using static variables" thread currently active, and
then the FAQ, and then the Usenet archives. How many times this simple
concept has to be explicitly explained?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER