Special types mixing pointers and arrays

Hi,
I have to call a function in some DLL
One parameter for the function is defined as:
float (***p)[3];
It somehow should hold a 4 dimensional array of floating point numbers...
With arrays of pointers to pointers,
But I'm not sure whether the [3] comes as first or last dimension...
And, anyway, I tried many options but couldn't allocate the wanted memory.
(I'm using Visual Studion 10 with C++)
Any ideas?
pointers are a tricky part.

it's an array of 3 pointer-to-pointer-to-pointer to float.
Note that a pointer is NOT an array and therfore this might not be used as an array.

consider the following:
1
2
3
4
5
6
7
int main()
{
    int value = 5;
    int* pvalue = &value;
    int** ppvalue = &pvalue; 
    int*** pppvalue = &ppvalue;
}


Now you have 1 integer called value which can be modified from pvalue.
pvalue can be modified from ppvalue and ppvalue can be modified from pppvalue.

pppvalue is of type int*** but it is NOT a 3-dimensional array. it just points to a pointer-to-pointer.

I hope that could help you :s
float (***p)[3];
it's an array of 3 pointer-to-pointer-to-pointer to float.

no, it's a pointer to pointer to pointer to an array of 3 floats. The parentheses make the difference.

cdecl.org can help in such cases: http://cdecl.org/?q=float+%28***p%29%5B3%5D
whooops, thank you!
Topic archived. No new replies allowed.