Given the following:
struct year{
int month;
int day;
int year;
};
struct person{
char fname[15];
char lname[15];
struct year birthday;
struct person *next;
};
struct person *current, *start;
Would you be able to allocate memory using the following:
start=(struct person *)malloc(sizeof(struct person));
current = start;
Will this include memory for the year structure contained in the person structure?
Would you be able to access a member of birthday with the following:
birth_month = current->birthday.month
I receive a segmentation fault error when the program tries to read data into the year structure:
("%s", current->birthday.year);
Thanks in advance