title: I am getting error in this code as "invalid indirection"
body: <p>I am trying to dynamically allocate a contiguous block of memory, store some integer value and display it.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  void main()
  {     int i;
        int *ptr;
        ptr=(void *)malloc(sizeof(int)*5); //allocation of memory
  
        for(i=0;i&lt;5;i++)
                {     scanf("%d",&amp;ptr[i]);
                }    
        for(i=0;i&lt;5;i++)
                {    printf("%d",*ptr[i]); //error is found here``                     
                }
  }    }
  </code></pre>