On 3 January 2012 00:27, Timon Gehr <timon.g...@gmx.ch> wrote: > On 01/03/2012 12:03 AM, RenatoL wrote: > >> I have: >> >> auto r = new int[][]; >> >> Error: new can only create structs, dynamic arrays or class objects >> , not int[][]'s >> >> while >> >> auto r = new int[][3]; >> >> is ok. >> > > new int[][3] is an alternate form of new int[][](3); new int[][3] > allocates an int[][] with 3 default-initialized elements. >
I assume `int[][] sth;` does what RenatoL wants to accomplish by `auto sth = new int[][];`. I do however have a question: is `auto sth = new int[][5];` the same as `int[][5] sth;`? If not, what is the difference?