1
typedef struct Monom{
int coeficient;
int exponent;
struct Monom* Next;
}Monom;
typedef struct list_polinom{
struct Monom* First_element;
}list_polinom;
int main(){
struct list_polinom* Polinoms;
struct Monom* Monoms;
Polinoms = (struct list_polinom*)malloc(x * sizeof(struct list_polinom));
Monoms = (struct Monom*)malloc(y * sizeof(stuct Monom));
Polinoms[0].First_element = &Monoms[z];
Monoms[z].exponent = x;
return 0;
}
所以我想打印printf("%d\n",Polinoms[0].First_element.exponent
),但我得到這個錯誤:打印一個struct指向另一個struct的成員?
[Error] request for member 'exponent' in something not a structure or union
我究竟做錯了什麼?
注:x,y,z是整數。