I'm trying to make couple of arrays out of a structure. I'm having difficulties in getting the values for every array ( for example I want to get 6 different arrays from a structure but I only get one array and then the program stops to the final stage). Can someone tell me what's wrong with my code?
#define NUM_OF_PLAYERS 6
typedef struct player
{
char name[20];
float height;
float avr_points;
int tshirt_num;
};
int main()
{
_flushall();
struct player players[NUM_OF_PLAYERS];
int i;
for (i=0 ; i<NUM_OF_PLAYERS ; i++);
{
printf("\nenter the name of the player, height in cm, \navrage points per game and number of his tshirt\n");
scanf("%s", &players[i].name);
scanf("%f", &players[i].height);
scanf("%f", &players[i].avr_points);
scanf("%d", &players[i].tshirt_num);
_flushall();
}