Tag: create 2D array

C Create Dynamic 2D array

In my last post, I create code to create 2D array in C++. Now, I try to create dynamic 2D array in C. Algorithm to create dynamic 2D array in C or C++ is same. This is a code to create dynamic 2D array in C : float **arrayf_create(int row, int col) { int i;

C++ create 2D array

How to create dynamic 2d array in C++ ? This is a code to create 2D array in C++ : float **ArrayLib::create2Array_float(int row, int col) { int i; float **out; out = new float*[row]; out[0] = new float[row*col]; for(i=1; i<row; i++) { out[i] = out[i-1] + col; } return out; } If you want to