01 Why i am not able to do this
int* px;
px = new int[2][2];
other the px = new int[2*2];
is there any other method
02 Why i am not able do access through pointer dx by dx[1][2]
other than by using dx[1*7+2]
static float mat[5][7] =
{
-5, -4, 0, 0, 0, 0, 0,
6, 4, 1, 0, 0, 0, 24,
1, 2, 0, 1, 0, 0, 6,
-1, 1, 0, 0, 1, 0, 1,
0, 1, 0, 0, 0, 1, 2
};
float *dx=&sim_max[0][0];
cout<<dx[1][0];
03 why i am not able to directly initialize array of new dynamically alloc. mem to
float *dx= new float[5*7]
(
-5, -4, 0, 0, 0, 0, 0,
6, 4, 1, 0, 0, 0, 24,
1, 2, 0, 1, 0, 0, 6,
-1, 1, 0, 0, 1, 0, 1,
0, 1, 0, 0, 0, 1, 2
);