those are my structers:
[CODE=c]
typedef struct _stud student;
typedef struct _grades grades;
struct _stud
{
char name[MAXSIZE];
grades gr;
};
struct _grades
{
double final;
char gpa;
};
[/CODE]
and this is the line where the code crach:
[CODE=c]
scanf("%lf", &s->gr.final);
[/CODE]
And those are the errors:
error C2079: 'gr' uses undefined struct '_grades'
error C2224: left of '.final' must have struct/union type
[CODE=c]
typedef struct _stud student;
typedef struct _grades grades;
struct _stud
{
char name[MAXSIZE];
grades gr;
};
struct _grades
{
double final;
char gpa;
};
[/CODE]
and this is the line where the code crach:
[CODE=c]
scanf("%lf", &s->gr.final);
[/CODE]
And those are the errors:
error C2079: 'gr' uses undefined struct '_grades'
error C2224: left of '.final' must have struct/union type
Comment