I want to pass information into members of the array of structures. I know the number of structure, n, and I have a pointer to the array. I want to step through each member of structure collecting the fields and then I want to move on to the next structure in the array.
something like this, but im not sure how to walk though each member of each structure within the array. I though about using an if(ch=="\n"), then iterate, but how do iterate the pointer, like this : ptr_array++?
Code:
data_t
read_into_array(bday_t *ptr_array, int n) {
int next;
printf("Enter a name, date of birth, month of birth, and year of birth: \n");
values_read = scanf("%s %d %d %d", ptr_array->name, &(ptr_array->day_of_birth), &(ptr_array->month_of_birth, &(ptr_array->year_of_birth));