i want to ask about using typedef struct and the
-> operator.i have this example from my study guide:
typedef struct _person
char name ;
struct _person *next;
they explain that the -> operator can be used as follows rptr->name.my
question is how do i write the statement for DATE birth using the ->
Your DATE definition is boguous, as it has 'day' two times. You may want
to have 'year' instead.
To use the -> operator you need a pointer to the struct, thus all you need
and then you can use rptr->birth.month for example.
[ back to toc ]