Re: need help on #271678 (sizefo struct?)
Vincent Zweije <firstname.lastname@example.org> writes:
> If you happen to have a variable (or field or in fact any expression)
> of that type (either type "struct x25_address" or type "x25_address"),
> then you can take the size of the variable, instead of the size of the
> type. So you can do:
> memcpy(&rt.address, &sx25.sx25_addr, sizeof sx25.sx25_addr);
> This will work with either definition of sx25_address.
D'oh, yes, very good point. That's the clearly better way of doing this;
I got too caught up in the wrong approach.
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>