title: Invalid application of sizeof to incomplete type with a struct
body: <p>I have a  struct where I put all the information about the players. That's my struct:</p>
  
  <pre><code>struct player{
     int startingCapital;
     int currentCapital;
     int startingPosition;
     int currentPosition;
     int activePlayer; 
     int canPlay;      
  };
  </code></pre>
  
  <p>And that's my main:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include "header.h"
  
  
  int main(int argc, char *argv[])
  {  int s,i,numOfPlayers;
     struct player *players;
      printf("Give the number of players: \n");
      scanf("%d",&amp;numOfPlayers);
  
      players = (struct player *)calloc(numOfPlayers,sizeof(struct player));
  
  
     system("PAUSE"); 
    return 0;
  }
  </code></pre>
  
  <p>I'm asking the user to give the number of players and then I try to allocate the needed memory. But I'm getting this compiler error that I can't figure out:</p>
  
  <pre><code>invalid application of `sizeof' to incomplete type `player'  
  </code></pre>