TITLE: Allocating a 2D array with new PROBLEM: jae@cstr.ed.ac.uk (John A. Elliott) 1) If you want to dynamically declare a multi-dim array, C++ should allow: int *ia = new int [10][10]; RESPONSE: ark@alice.att.com (Andrew Koenig) AT&T Bell Laboratories, Murray Hill NJ Not quite. If T is an array type, the type of `new T' is `pointer to element of T.' So, if you allocate an array of arrays, what you get back should be a pointer to the initial element of that array, which is itself an array. You should therefore write int (*ia)[10] = new int [10][10]; Note that the first 10 after "new" can be an arbitrary expression but the second one cannot -- it becomes part of the type of the result.