In C, does a pointer to a structure always point to its first member?

Yes, the C standard specifically guarantees that this will work.

(C1x §6.7.2.1.13: “A pointer to a structure object, suitably converted, points to its initial member … and vice versa. There may be unnamed padding within as structure object, but not at its beginning.”)

Leave a Comment