I’m looking through the source of a C# program that uses a library written in C. I came across this line and was unsure what it was:
cvbimUNSAFE.GetImageVPA ((cvbim.IMG)cvImg.Image, 0, (void**)&lpImageBits, &pVPAT);
What is an object of type void **? I did some Google searches and could only find information about void*, which is a pointer to a sort of catch all top level type, if I understood correctly.
It’s a pointer to a pointer to something not specified. Basically, just think of it as a memory pointer to a raw memory pointer.
So,
int**is a pointer to a pointer to anint, butvoid**is a pointer to a pointer, but it’s not specified what that pointer is pointing at.Not quite.
void*is a pointer to something, it’s just not specified what that something is and should just be thought of as a pointer to a raw hunk of memory that you have to apply some structure to. For example,mallocreturns avoid*because it’s returning a pointer to a raw hunk of memory.