Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!mit-eddie!mit-vax!jouvelot From: jouvelot@mit-vax.LCS.MIT.EDU (Pierre Jouvelot) Newsgroups: comp.lang.c Subject: Re: Question on structures Message-ID: <2986@mit-vax.LCS.MIT.EDU> Date: Fri, 30-Oct-87 16:01:14 EST Article-I.D.: mit-vax.2986 Posted: Fri Oct 30 16:01:14 1987 Date-Received: Wed, 4-Nov-87 23:24:18 EST References: <1025@phoenix.Princeton.EDU> Reply-To: jouvelot@mit-vax.UUCP (Pierre Jouvelot) Organization: MIT Laboratory for Computer Science, Cambridge Lines: 33 In article <1025@phoenix.Princeton.EDU> asjoshi@phoenix.UUCP (Amit S. Joshi) writes: > "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 ?. A simple solution (sligthly inefficient). Rewrite with a.b.c begin d = 10 ; e.f = 3.4 end as { struct *s = &a.b.c ; s->d = 10 ; s->e.f = 3.4 ; } where is the type of a.b.c. If you like, I guess to can define a WITH macro which will do that automatically (modulo the name of the local structure pointer). Pierre -- Pierre Jouvelot Room NE43-403 ARPA: jouvelot@xx.lcs.mit.edu Lab for Computer Science USENET: decvax!mit-vax!jouvelot MIT (or mcvax!litp!pj) 545, Technology Square TPH: (617) 253-0884 Cambridge, MA 02139 USA