finding offset of a member in C structures

Doug Gwyn gwyn at smoke.brl.mil
Thu May 23 06:56:17 AEST 1991


In article <22103 at paperboy.OSF.ORG> dbrooks at osf.org (David Brooks) writes:
>In article <16220 at smoke.brl.mil>, gwyn at smoke.brl.mil (Doug Gwyn) writes:
>|> ...  If you understood my example, you should be able to apply
>|> the technique whenever you can latch onto, for example, a pointer to a
>|> struct of the appropriate type.
>As I said, the ubiquitous uses in X don't have that luxury.

But that's merely a design botch, because in order to ask for the offset
of a structure member one HAS to have a particular structure type in mind;
to make any use of the information one has to have a suitable pointer at
hand.  (The design botch is analogous to Berkeley's CTRL(x) macro.)



More information about the Comp.lang.c mailing list