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

Re: 2-D arrays in C++



>> typedef int foo[4];
>> foo *x;
>> x = new foo[6];
I should've added a little more detail:
This would be for something like an image class for variable sized images.
So you could say something like (in C++):
graphic::graphic(int width,int height){
     itsDataPtr=new int[width][height];
}
So the width and height are not known at compile time, only at run time.
Thanks-
Brett