I'm not sure about "cleanest way", but there's nothing you can do except to dereference those pointers. I suggest using typedefs
just to make your code more readable.
Also don't worry about casting int *
to int **
. Sure it's considered "bad practice", but if you know what you're doing it might be exactly what is required. You just have to be careful.
typedef int *** intPtr3;
typedef int ****** intPtr6;
You can also use some macros to clean up your syntax. This would be a good example of intelligently using a macro to benefit readability and cleanliness, and reduce chance of errors:
#define DEREF6( PTR ) \
******(PTR)
Lastly there's a nice macro I use quite often for moving a pointer an amount of bytes in memory:
#define PTR_ADD( PTR, OFFSET ) \
(((char *)(PTR)) + (OFFSET))