Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!TGMIKEY%CALSTATE.BITNET@wiscvm.wisc.EDU From: TGMIKEY%CALSTATE.BITNET@wiscvm.wisc.EDU (Account Manager) Newsgroups: comp.lang.c Subject: RE: Question on structures Message-ID: <10295@brl-adm.ARPA> Date: Thu, 12-Nov-87 15:48:10 EST Article-I.D.: brl-adm.10295 Posted: Thu Nov 12 15:48:10 1987 Date-Received: Sat, 14-Nov-87 19:22:59 EST Sender: news@brl-adm.ARPA Lines: 46 Received: by CALSTATE via BITNet with NJF for TGMIKEY@CALSTATE; Comment: 10 Nov 87 02:54:35 PST Received: by BYUADMIN (Mailer X1.24) id 1937; Tue, 10 Nov 87 03:52:33 MST Date: 30 Oct 87 17:44:39 GMT Reply-To: Info-C@BRL.ARPA Sender: INFO-C@NDSUVM1 From: asjoshi@phoenix.Princeton.EDU Subject: Question on structures Comments: To: info-c@BRL-SMOKE.arpa To: TGMIKEY@CCS.CSUSCC.CALSTATE.EDU Hi, I have a question on structures. It is as follows: I have gotten really tired of typing things like a.b.c.d etc to refer to elements of a structure. I remember that pascal provided me with a 'with' construction which allowed me to say something like "with a.b.c {now refering to d really means use a.b.c.d } ..." I was wondering if there is some similar contruct in C. I might be missing something obvious, I wonder if somebody could help me ?. I know I could of course make a local copy in the program of every variable in the structures and then use the local copy but that seems inefficient and would be quite unclear. Thanks, -- Amit Joshi BITNET : Q3696@PUCC.BITNET USENET : ...seismo!princeton!phoenix!asjoshi "There's a pleasure in being mad ...which none but madmen know!" St.Dryden ===== Reply from Mike Khosraviani ========================== Unfortunately, C has nothing like the WITH statement in Pascal. Howerver, there are many ways of getting around the extra typing that you have to do! One quick and dirty way is to use SUPERKEY. I am assuming that you know what SUPERKEY is and how it works. If not, let me know and I'll provide you with more information. For short, SUPERKEY can reduce a lot of typing that you have to do. It is GREAT!!!! Mike says hi and have lots of FUN