Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: sizeof a struc field Message-ID: <11317@smoke.BRL.MIL> Date: 17 Oct 89 04:52:56 GMT References: <7710@microsoft.UUCP> <44200027@uicsrd.csrd.uiuc.edu> <5752@merlin.usc.edu> <10201@xanth.cs.odu.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <10201@xanth.cs.odu.edu> kremer@cs.odu.edu (Lloyd Kremer) writes: >Neither is adequate if you wish to know the effective size of the member >including structure padding. Then use the difference of two offsetof()s. The size of struct padding is not very useful to know; it's the offset of a struct member that is the information of use in programming. offsetof() is required to be provided by the implementation precisely because there is no portable way of computing struct member offsets without it.