Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!ugle.unit.no!nuug!ifi!enag From: enag@ifi.uio.no (Erik Naggum) Newsgroups: comp.lang.c Subject: Re: Addressing struct without -> Message-ID: Date: 3 Feb 91 22:37:37 GMT References: <91010.084408NIBMSCM@NDSUVM1.BITNET> <10615@jarthur.Claremont.EDU> Sender: enag@ifi.uio.no (Erik Naggum) Organization: Naggum Software, Oslo, Norway Lines: 26 In-Reply-To: dfoster@jarthur.Claremont.EDU's message of 1 Feb 91 23:36:55 GMT In article <10615@jarthur.Claremont.EDU>, Derek R. Foster writes: In article , Wolfram Roesler writes: >I'm not sure if the following will work: > >struct >{ > int foo; > int bar; >} xyz; >#define foo xyz.foo >#define bar xyz.bar Probably not. You've created circular definitions of foo and bar with the preprocessor. ("foo" expands to "xyz.foo" which expands to "xyz.xyz.foo" ad infinitum.) Only in some compilers. ANSI C, most notably, disables expansion of the macro name being defined in the body of the definition, as well as in the expansion of macroes used in the definition. Very handy. -- When will "All the world's a VAX" be replaced by "All the world's ANSI C"? -- [Erik Naggum] Snail: Naggum Software / BOX 1570 VIKA / 0118 OSLO / NORWAY Mail: , My opinions. Wail: +47-2-836-863 Another int'l standards dude.