hey i was told to use fgets instead of scanf to read in strings that are separated by whitespace characters but the way i have it here is wrong. the error says "request for member 'name' in something not a structure or a union". any tips on how to make it correct? cheers. THE ERROR IS ON LINE 43.
Code:
#include <stdio.h>
#include <stdlib.h>
struct bones
{
char name[20];
int played;
int won;
int drawn;
int lost;
int points;
};
struct bones team[4];
int main()
{
int i;
for(i=0;i<4;i++)
{
team[i].played = 0;
team[i].won = 0;
team[i].lost = 0;
team[i].drawn = 0;
team[i].points = 0;
}
for(i=0;i<4;i++)
{
printf("enter each team name\n");
fgets(team.name[i], 20, stdin);
}
return(0);
}