[quote]I’ve checked, and same is true for bi-dimensional arrays:
Float_t **x;
x=new Float_t[10][10];
Thanks,
[/quote]
Yes, because you programm is ill-formed.
expression new float[10][10] returns float ()[10] which is a pointer to array of ten floats, not a pointer to pointer to float.
new float[10][10][10] will return float()[10][10] - pointer to an array of 10 arrays of 10 floats.
I guess, you see the difference between float (*)[10] and float ** - these are completely different types.
Usually, two dimensional array with float ** created in two steps:
float ** ptr = new float *[10];
for(int i = 0; i < 10; ++i)
ptr[i] = new float[10];
//It’s just an example, it’s not good way to programm in C++.
When you write now
ptr[0][0] = 1.f;
this means
((ptr + 0) + 0) = 1.f; - i.e. you have a pointer to the 0th elementh of array of pointers, you dereference it - *(ptr + 0) or ptr[0] and this expression gives you 0th element in an array of pointers. This pointer points to 0th element of array of floats. After that, you dereference this pointer - ptr[0][0] or ((ptr + 0) + 0) and you get 0th element of array of floats.
Now:
float (*ptr)[10] = new float[10][10];
this is completely different situation.
ptr[0] gives you an array of 10 floats, ptr[1] will give you NEXT array of 10 floats etc.
So:
-
float ** ptr = ///code from the first sample
ptr holds address of 0th elementh of such array
[][][][][][][][][][] //sheme
^ptr
float (*ptr)[10] = ///the second sample
[ [float][float][float][float][float][float][float][float][float][float] ][[.etc/
^ptr
PS AFAIK now cint cannot work correctly with multidimensional dynamic arrays created this way.