У меня есть структура, в которую я помещаю всю информацию об игроках. Это моя структура:
struct player{
int startingCapital;
int currentCapital;
int startingPosition;
int currentPosition;
int activePlayer;
int canPlay;
};
И это моя основная:
#include <stdio.h>
#include <stdlib.h>
#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",&numOfPlayers);
players = (struct player *)calloc(numOfPlayers,sizeof(struct player));
system("PAUSE");
return 0;
}
Я прошу пользователя указать количество игроков, а затем я пытаюсь выделить необходимую память. Но я получаю эту ошибку компилятора, которую не могу понять:
invalid application of `sizeof' to incomplete type `player'