I'm trying to create a class called "team" that has a structure called "player" as one of its members. There will many players so I'm also creating an array called "totalplayers" which has a value of 100. This is where I'm getting an error. Can someone tell me why my last line of code below is wrong? I also tried the format team.player totalplayers[maxplayers] in the last line but that didn't work either.
More broadly, what is the best way to create an array of structures within a class? I am a newbie so this may be straightforward but I've never done it before.
class team {
public:
int teamNumber;
string name;
int currentPlayerCount;
int budget;
float powerRank;
struct player {
int rank;
string name;
string position;
string state;
string height;
int weight;
string school;
float forty_time;
int bench;
float visitScore;
};
};
constint maxplayers = 100;
player totalplayers[maxplayers];