Hello, I had a question regarding nested structures. Lets say you *have* to use the following structures: (disregard the numbers thrown in, I just tossed random numbers in).
typedef struct info{
char name[20];
char address[50];
char serial[15];
} PERSONAL;
typedef struct person{
PERSONAL individual[50];
int number;
} PERSON;
I need to scan in all the data from a file. The file has the following format:
name
address
serial code
name
address
serial code
and repeats. Storing the data into a structure PERSONAL is easy, however, the instructions say I need to do it from PERSON. How do I go about that? What would be the declaration? Like, for PERSONAL, I could do the following:
PERSONAL tom[MAX];
printf("%s", tom.address);
How would I do this if I had to store everything into PERSON from the get go? This is all in regular C