title: Invalid type argument of -> C structs
body: <p>I am trying to access items in an array of structs and print the structs fields as follows</p>
  
  <pre><code>printList(Album *a, int numOfStructs)
  {
      int i;
      int j;
  
      for(i = 0; i &lt; numOfStructs; i++)
      {
           printf("number%d\n:", i+1);
           printf("%s", a[i]-&gt;field2);
           printf("%s", a[i]-&gt;field2);
           printf("%d", a[i]-&gt;field3);
  
           for(j = 0; j &lt; a[i]-&gt;numOfStrings; j++)
           {
               printf("%s", a[i]-&gt;strings[j]);
           }
           printf("\n");
      }
  }
  </code></pre>
  
  <p>but I get loads of errors as such</p>
  
  <blockquote>
    <p>invalid type argument of '->'</p>
  </blockquote>
  
  <p>What am I doing wrong with this pointer?</p>