Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!pyramid!weitek!rober From: rober@weitek.UUCP (Don Rober) Newsgroups: comp.lang.c Subject: Re: Question on structures Message-ID: <5673@weitek.UUCP> Date: Mon, 2-Nov-87 22:57:59 EST Article-I.D.: weitek.5673 Posted: Mon Nov 2 22:57:59 1987 Date-Received: Fri, 6-Nov-87 06:58:30 EST References: <1025@phoenix.Princeton.EDU> <2986@mit-vax.LCS.MIT.EDU> Reply-To: rober@weitek.UUCP (Don Rober) Organization: WEITEK Corp. Sunnyvale Ca. Lines: 16 >A simple solution (sligthly inefficient). Rewrite > with a.b.c begin > d = 10 ; > end >as > { > struct *s = &a.b.c ; > s->d = 10 ; > } A vastly superior solution in that there is nothing implicit happening. The typical Pascal error is that it is never clear what 'd' is a reference to. (for example, declare a local variable by the name of 'd' - which one is referenced?) This C solution obviates the problem and is worth whatever the cost may be. -- ---------------------------------------------------------------------------- Don Rober UUCP: {pyramid, cae780}!weitek!rober Weitek Corporation 1060 East Arques Sunnyvale, CA 94086