title: C void pointer arithmetic
body: <p>I thought that in gcc, void * and char * are treated the same way when it comes to pointer arithmetic, i.e. void * "points" to a single byte in memory, so the following code</p>
  
  <pre><code>void *p;
  p = malloc(sizeof(void));
  printf("%p %p\n",p,p+1);
  </code></pre>
  
  <p>indeed returns <code>0x984a008 0x984a009</code>. Similarly, void ** points to a pointer, so an increment by one really means an increment by 4 bytes (on a 32 bit OS), i.e. </p>
  
  <pre><code>void **p;
  p = (void **) malloc(sizeof(void *));
  printf("%p %p\n",p,p+1);
  </code></pre>
  
  <p>returns <code>0x984a008 0x984a00c</code>. However, the following code confuses me</p>
  
  <pre><code>void **p, *p1;
  p = (void **) malloc(sizeof(void *));
  p1 = (void **) p;
  printf("%p %p\n",p1,p1+1);
  </code></pre>
  
  <p>Since it returns again <code>0x984a008 0x984a009</code>. What is going on here? </p>