TITLE: Array construction and intiialization PROBLEM: Josh Mittleman (mittle@watson.ibm.com), 17 Sep 92 According to ARM, an array of class objects can be declared with an initializer list (p.289), but cannot be allocated with new only if the class has a default constructor (p.61). Thus: class thing { public: thing(int); thing(char*, int = 0); }; thing s[3] = { 1, "hello", thing("bye", 3) }; // correct thing *t = new thing[3]; // error: no thing::thing() class thing2 { /* no explicit constructor ... */ }; thing2 u[3]; // correct thing2 *v = new thing2[3]; // correct [ In summary, global/automatic arrays can have initializers, but heap-allocated arrays cannot. These use the default constructor (which must be supplied). -adc ]