Quiero el offsetof() la línea param en mystruct1
. He intentado¿Cómo se usa offsetof() en una estructura?
offsetof(struct mystruct1, rec.structPtr1.u_line.line)
y también
offsetof(struct mystruct1, line)
pero no funciona ninguno.
union {
struct mystruct1 structPtr1;
struct mystruct2 structPtr2;
} rec;
typedef struct mystruct1 {
union {
struct {
short len;
char buf[2];
} line;
struct {
short len;
} logo;
} u_line;
};
¿No puede proporcionarnos un código compilable para las definiciones de estructura?O omita la 'struct mystruct2' ... –
¿qué quiere decir con" ninguno funciona "? –