I have the following structures, and I want be able to access elements of the StudentType:
typedef struct {
int studentID;
char name[MAX_STR];
char degree[MAX_STR];
} StudentType;
typedef struct {
StudentType *elements[MAX_ARR];
int size;
} StudentArrType;
My function:
void initStuArr(int studentID, char *name, char *degree, StudentType **stu, StudentArrType **stuArr){
I have tried the following both of which don't allow me to access *elements:
stuArr->*elements->studentID = studentID
and
stuArr->(*elements)->studentID = studentID
I am receiving the error: expected identifier before '*' token and '(' token when I try the 2 above. when I try stuArr->elements->studentID = student ID
without using the *, I get the error: request for member 'elements' in something not a structure or union.
How can I access *elements?