У меня есть структура, где я размещаю всю информацию о игроках. Что моя структура:
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'