title: Why use a void pointer for dereferencing variables of datatypes?
body: <p><strong>Dereferencing a float variable using a void pointer:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      float a = 7.5;
      void *vp = &amp;a;
      printf("%f", *(float*)vp); /* Typecasting a void pointer to float for dereference */
      printf("\n");
  }
  </code></pre>
  
  <p>Output: <code>7.500000</code></p>
  
  <p><strong>Dereferencing a variable using an integer pointer:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      float a = 7.5;
      int *ip = &amp;a;
      printf("%f", *(float*)ip); /* Typecasting an int pointer to float for dereference */
      printf("\n");
  }
  </code></pre>
  
  <p>Output: <code>7.500000</code></p>
  
  <p>In both, the outputs are same. What is the reason to go for dereferencing of different datatype variable, when we are able to do by typecasting a normal pointer?</p>