Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!apple!netcom!avery From: avery@netcom.UUCP (Avery Colter) Newsgroups: comp.lang.c Subject: Re: Addressing struct without -> Message-ID: <22711@netcom.UUCP> Date: 3 Feb 91 21:59:53 GMT Organization: Netcom- The Bay Area's Public Access Unix System {408 241-9760 guest} Lines: 23 Henry Spencer writes: >In article <91010.084408NIBMSCM@NDSUVM1.BITNET> NIBMSCM@NDSUVM1.BITNET writes: >>with some other languages, such as Pascal, I had the capability to use >>the 'using' keyword, giving the address of a structure and then address >>the elements of that structure without the necessity of using the >>ptr->element notation (could simply use element). >> Could anyone out there tell me how I can implement this in 'C' ... >Can't be done (in any convenient way) in standard C. How about.... #define element ptr->element for each element involved? Then, in the program itself, use ptr as a dummy, assigning it to point to whichever structure is appropos. -- Avery Ray Colter {apple|claris}!netcom!avery {decwrl|mips|sgi}!btr!elfcat (415) 839-4567 "I feel love has got to come on and I want it: Something big and lovely!" - The B-52s, "Channel Z"