title: How to solve "Array has incomplete element type" in C
body: <p>I have been working on <code>CS50</code> where I'm doing <code>struct</code> to allow user to input and save it in an array. However, I get</p>
  <blockquote>
  <p>array has incomplete element type struct person</p>
  </blockquote>
  <p>Below here is the program I'm working on:</p>
  <p><strong>Phonebook.c</strong></p>
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  #include&lt;cs50.h&gt;
  #include&lt;ctype.h&gt;
  #define MAX 4
  
  typedef struct  
  {
      char name[20];
      char number[8];
  }person;
  
  int main ()
  {
      struct person ppl[MAX];
      int i;
      
      for(i = 0;i &lt; MAX; i++ )
      {
          printf(&quot;\nEnter details of user %d\n\n&quot;, i+1);
          
          printf(&quot;Enter name: &quot;);
          scanf(&quot;%s&quot;, ppl[i].name);
          
          printf(&quot;Enter phone number: &quot;);
          scanf(&quot;%s&quot;, ppl[i].number);
      }
      
      printf(&quot;\n&quot;);
      
      printf(&quot;Name\tPhone Number\n&quot;);
      
      for(i = 0; i &lt; MAX; i++)
      {
          printf(&quot;%s\t%s\n&quot;, ppl[i].name, ppl[i].number);
      }
      
      return 0;
  }
  </code></pre>
  <p><strong>Error Stacktrace</strong></p>
  <pre><code>clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow    Phonebook.c  -lcrypt -lcs50 -lm -o Phonebook
  Phonebook.c:15:22: error: array has incomplete element type 'struct person'
      struct person ppl[MAX];
                       ^
  Phonebook.c:15:12: note: forward declaration of 'struct person'
      struct person ppl[MAX];
             ^
  1 error generated.
  make: *** [&lt;builtin&gt;: Phonebook] Error 1
  </code></pre>
  <p>How do I solve this issue? Please enlighten me on this</p>