Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: XtOffset implementation problem Message-ID: <9006270654.AA01467@Larry.McRCIM.McGill.EDU> Date: 27 Jun 90 06:54:52 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 16 [trying to find an XtOffset that works on a certain compiler] >> #define XtOffset(T,M) (int)(char *)&((T)0)->M >> #define XtOffset(T,M) ((char *)&((T)0)->M - (char *)0) >> static int foo; >> #define XtOffset(T,M) ((char *)&((T)&foo)->M - (char *)&foo) > I have a litle difficulty understanding these. Why the `0' following > `(T)' in the first two, and the `&foo' following `(T)' in the second. The T argument is expected to be a type (a struct pointer type), not an object of any sort. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu