title: invalid type argument of ‘->’
body: <p>i am getting error as  "invalid type argument of ‘->’ " on the below two marked lines
  please suggest how to correct it</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  struct arr{
      int distance;
      int vertex;
  };
  
  struct heap{
      struct arr * array;
  
       int count; //# of elements
       int capacity;// size of heap
       int heapType; // min heap or max heap
  };
  
  
  int main(){
      int i;
      struct heap * H=(struct heap *)malloc(sizeof(struct heap));
      H-&gt;array=(struct arr *)malloc(10*sizeof(struct arr));
  
      H-&gt;array[0]-&gt;distance=20;//error
  
      i=H-&gt;array[0]-&gt;distance;//error
  
      printf("%d",i);
  }
  </code></pre>