Page 1 of 1

Initializing member arrays in constructors

Posted: Thu Nov 22, 2007 4:06 pm
by ImLazy
In this code:

Code: Select all

class C {
    int a[10];
    int b;

    C(): b(1) {}
}
Is there any way to initialize the array a in the constructor like the ":b(1)"? I tried "a({0})" and "a(0)" but failed.

Posted: Thu Nov 22, 2007 4:17 pm
by mf
No.