My unit doesn't teach this so I am unaware about the correct syntax to go about what I want to do. I have hit google but have produced no answers to my specific problem. So here we go.
I have a series of nested structs.
Is this possible that instead of typing - program.week[0].workout[0].exercise[0].exerciseName
everytime I want to access an element.
That I can access the elements of the most nested struct via a pointer.
Eg.
clientProgram *prtToWorkout;
prtToWorkout = &(myProgram.week[0].workout[wkOut]);
PopulateWorkout(&prtToWorkout, numberOfExercises); //Funct call
void PopulateWorkout(clientProgram *prtToWorkout, int numOfEx)
{
printf("Enter program grouping letter eg. A: ");
scanf("%c%*c", &(*prtToWorkout)->programName.exercise[ex_num].exerciseName);
}
Hope you guys can help shine some light on this one for me..
Regards,
Nate