Voglio l'offsetof() della riga param in mystruct1
. Ho provatoCome si usa offsetof() su una struct?
offsetof(struct mystruct1, rec.structPtr1.u_line.line)
e anche
offsetof(struct mystruct1, line)
ma né opere.
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;
};
Non puoi fornirci codice compilabile per le definizioni della struttura?O omettere 'struct mystruct2' ... –
cosa intendi con" né funziona "? –