I have seen a function whose prototype is:
int myfunc(void** ppt)
This function is called in a C file as a = myfunc(mystruct **var1);<
Yes, void **
is perfectly acceptable and quite useful in certain circumstances. Also consider that given the declaration void **foo
and void *bar
, the compiler will know the size of the object pointed to by foo (it points to a pointer, and all pointers are the same size except on a few ancient platforms you needn't worry about), but it will not know the size of the object pointed to by bar (it could point to an object of any size). You can therefore safely perform pointer arithmetic on void **
pointers but not on void *
pointers. You must cast them to something else first, like a char *
. GCC will allow you to pretend that void *
and char *
are equivalent, each pointing to an object a single byte in size, but this is nonstandard and nonportable.