[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2-D arrays in C++



> So, for a two dimensional array I would like to do something like...
> int **x;
> x=new int[6][4];
> x[2][1]=3;

You can't do it.  When using 2D arrays C(++) does the equivelent of
work around one (x[2 * width + 1]).  As far as I know there is no
way to have c++ do it automatically for dynamically allocated arrays.

Dennis Payne
payned@rpi.edu