Union in Struct Error
Mam następującą strukturę:
struct type1 {
struct type2 *node;
union element {
struct type3 *e;
int val;
};
};
Podczas inicjowania wskaźnika*f
to wskazuje na wystąpienietype1
i robiąc coś takiego:f.element->e
lub nawet po prostuf.element
, Dostaję:
error: request for member ‘element’ in something not a structure or union
Co tu nadzoruję?