I'm working on a program that takes some information about members of a team using structures then displays it. My compiler is not happy about my use of brackets, but I can't seem to figure out what the problem is. I get the above error in lines 20, 22, 24, 25, 28, 40, and 41, so obviously I've made the same mistake over and over. Here's my code:
I think you intend for an array of a given number of players of type Player. How many players are on the team?
Assuming it is 4, do this with your struct instead:
1 2 3 4 5 6
struct Player
{
char name [15];
int jersey;
int points;
} team[4];
Then get rid of your declaration of team inside main() as it can be done just as well in your struct. Or define it like this if you need to limit scope: Player team[4];
You are trying to work on your team like it is an array. Making these corrections will allow you to do so.