Duck taped something together
class Int2DArray { int data[]; int I, J; public: Int2DArray(); ~Int2DArray(); void put(int i,int j,int value); int get(int i,int j); void size(int rows, int colums); void printme(); }; void Int2DArray::Int2DArray(void) { //nothing } void Int2DArray::size(int rows,int columns) { I = rows; J = columns; ArrayResize(data,I*J); } void Int2DArray::~Int2DArray(void) { //nothing } int Int2DArray::get(int i,int j) { return data[j + i*J]; } void Int2DArray::put(int i,int j,int value) { data[j + i*J] = value; } void Int2DArray::printme(void) { string poop = ""; string s = "wave"; for (int i = 0; i < I; i++) { for (int j = 0; j < J; j++) { StringAdd(poop," "); StringAdd(poop,get(i,j)); } Print(poop); poop = ""; } }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi I need to make an array in a procedure whose size is given by input arguments
void foo(int x, int y) {
int A[x][y]; //Make a x-by-y array
}
Doing it as shown gives an error. It looks like you can only resize one dimension of a dynamic array with ArrayResize() ? Help!