| 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
.
|
|
|
|

|
Related Articles |
|
|