What is going on here in this line:
-1[0[ptr]][0]
What is going on here in this line:
-1[0[ptr]][0]
Technically speaking, that is valid C code, but it is not worth writing it like that. Consider this stupid example.
char v = array[3];
Now, we can rewrite that in pointer arithmetic. e.g.
char v = *(array + 3);
However, since addition is commutative, it follows that this is also valid:
char v = *(3 + array);
And since addition is commutative, it therefore follows that array brackets are also commutative. So this is perfectly valid in C:
char v = 3[array];
If you wish to untangle the code you've posted, you can do it in steps....
float f0(float*** ptr)
{
return -1[0[ptr]][0];
}
float f1(float*** ptr)
{
return -1[ptr[0]][0];
}
float f2(float*** ptr)
{
return -ptr[0][1][0];
}
And here is the proof they are the same:
(f2 and f3 just result in tail calls to f1)
/edit I think it's a little unfair you've been marked down so harshly for asking this question. It's actually a cool quirk of C/C++ that very few people know.