im trying to create a structure that contains an array of structures but i keep getting error when compiling the code (corrupt stack). just to make sure, is my struct code correct?
typedef struct status *StatusPointer;
struct status {
int item;
}array[MAX_NUM];
typedef struct allStatus *AllStatusPointer;
struct allStatus {
StatusPointer array[MAX_NUM];
};
if thats fine, how do i call the value of any item in the struct?
AllStatusPointer group1;
group1 = (AllStatusPointer)malloc (sizeof (struct allStatus));
//group1 != NULL
int james =group1->array[0]->item;
should this works?
Im using C