title: Print values of void pointer
body: <p>I have a funciton that returns a void pointer. Lets say I know that the block of data pointed at is an array of ints. How can I print them?</p>
  
  <p>From another thread I saw that I cast the void as my desired data type this way:</p>
  
  <pre><code>printf("%i",*((int*)data));
  </code></pre>
  
  <p>But like I said that data is an array of ints. I tried to do this, but it's not a valid expression:</p>
  
  <pre><code>for(i = 0; i&lt;3; i++){
      printf("%i \n", *((int*)(data+sizeof(int)*i)));
  }
  </code></pre>
  
  <p>What is the proper way of printing this?</p>