void**

what is the meaning of void**....
closed account (z05DSL3A)
That is a pointer to a void pointer. A void pointer can't be dereferenced, but a void** can. I.e.

void *x[100];
void **xp = x;

With the above declaration of xp you should be able to do e.g. xp[17] to get at the 18th element of the array x.

PS. Please post your questions once.
Last edited on
It's a pointer to a pointer to void (unspecified type). It means that this variable (memory location) contains an address to a memory location, that contains an address to another memory location, and what is stored there is not specified.

To be used for something useful, the pointer that it points to has to be casted to something.

1
2
3
4
5
6
7
8
9
10
11
int i = 10;

void * vp = &i;
void ** vpp = &vp;

// ...

void * other = *vpp; // Get address that vpp is pointing to
int * ip = static_cast<int*>(other); // Cast to pointer to integer
int j = *ip; // Read an int from the same memory location
// j == i == 10; 
Thanks for ur guidence wolf and ropez......sorry wolf, technical error...:)
Topic archived. No new replies allowed.