# I don't understand ??? about void *



## killwin (May 24, 2010)

Hello,

```
struct Exp_ {
   struct Exp_ *a;
   struct Exp_ *b;
} Exp

int main(void) {
   Exp *n;
   init_exp(n, a, b);

   printf("line 1 : %p %p\n", &(n->a), &(n->b));

   void **g;
   g = n;

   printf("line 2 : %p %p\n", g, sizeof(void *), g + sizeof(void *));

   return 0
}
```
result :


```
line 1 : 0x28202060 0x28202064
line 2 : 0x28202060 4 0x28202070
```

I don't understand, why g + sizeof(void *) = 0x28202070 and not 0x28202064

60 + 4 = 64 !!!! 

What is it ? Thanks


----------



## killwin (May 24, 2010)

*solved*

sorry, it was a stupid question.

It's not *(g + sizeof(void *)), but *(g + 1)


----------



## graudeejs (May 24, 2010)

*void ** is pointer, *sizeof(void *)* is size of pointer (4B on 32bit arch)
*&(n->a)* is memory address of *a* element in *n* structure


----------

