what is syntax for creating a structure with a pointer to another structure if these 2 structures are in the same complex structure.
Here is what I tried to do and the compiler is very mad about it. To be specific, it is expecting something before the "=" token.
Code
typedef struct {
float max;
}maxHolder;
typedef struct {
float min;
maxHolder maxFloat;
}minHolder;
typedef struct {
float a;
float b;
float c;
float d;
float e;
minHolder minFloat;
}maxStruct;
typedef struct {
float f;
float g;
float h;
float i;
float j;
maxStruct *maxGroup = malloc(1*sizeof(maxStruct);
}minStruct;
minStruct floatList;
I have also tried
Code
maxStruct maxGroup1;
maxStruct *maxGroup;
maxGroup = &maxGroup1;
and a lot of variations of that. I am just missing something here that I'd like help with please.
This post was edited by Nom_Nomz on Dec 9 2012 12:20pm