Bari wrote:
I just wanted to know if I can ininialize data members in the header.
Only static ones and only ones of a const integral type.
The compiler (gcc 2.96) returns an error.
That's a very old compiler. Try something newer.
The data members are not const (I know that const members can't be
initiated in the header).
Huh?
Does anyone no the reason?
The reason is that the Standard prohibits initialisation of non-static
data members anywhere except the constructor initialiser list, and also
prohibits initialisation of static members if they are non-const or if
they are of non-integral type.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask