* Jacques Labuschagne:[color=blue]
>
jut_bit_zx@eyou.com wrote:
>[color=green]
> > class A
> > {
> > public:
> > A();
> > virtual ~A(){}
> > ...
> >
> > private:
> > int m_iarray[10];
> > }
> >
> > How can I initialize "m_iarray" int the member initialization list? If
> > cann't, then why?
> >[/color]
>
> You can't, because there's no supported syntax. :-) Who knows, there
> might even be a compelling technical reason.
> You could use vectors with the "vector::vector(size_type n, const T&
> value = T())" constructor, but that doesn't help if you wanted the
> elements to have different values.[/color]
An array can be default-initialized, which for this array means
zero-initialized, via the constructor initializer list.
However, MSVC 7.1 doesn't support that; it compiles but doesn't give the
initialization it should.
I suspect there are also other commonly used compilers that don't support it.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?