title: Using void pointer to an array
body: <p>I was just trying to use a void pointer to an integer array ,I tried to see if i can print the array back by casting it back into int. But it is giving me some random value. Can you tell me where i am going wrong?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  int main(){
      int a[5];
      int x;
      int j;
  
      a[0]=1;
      a[1]=2;
      a[2]=3;
      a[3]=4;
  
      void *arr=a;
  
      for(j=0;j&lt;4;j++){
          x = *(int *)(arr+j);
          printf("%d",x);
      }
      return 0;
  }
  </code></pre>
  
  <p>Output is this:  </p>
  
  <pre><code>133554432131072512
  </code></pre>
  
  <p>Why is it not pinting elements of array a[] i.e 1,2,3,4 ?</p>