title: Dereference with (void *) in front
body: <p>I have some doubts on dereferencing of C pointers.  Given the following code:</p>
  
  <pre><code>void *vptr; // declare as a void pointer type
  int val = 1;
  int *iptr;
  
  // void type can hold any pointer type or reference
  iptr = &amp;val;
  vptr = iptr;
  printf("iptr=%p, vptr=%p\n", (void *)iptr, (void *)vptr);
  </code></pre>
  
  <p>When we do <code>(void *)iptr</code>, what are we actually printing? I thought that when dereferencing, it should print the number 1, but it actually prints an address. Why is that? And why is it necessary to add <code>(void *)</code> in front in order to print the address? Wouldn't <code>iptr</code> be enough?</p>
  
  <p>Thanks</p>