Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!pilchuck!dataio!bright From: bright@dataio.Data-IO.COM (Walter Bright) Newsgroups: comp.lang.c Subject: Re: Question on structures Message-ID: <1407@dataio.Data-IO.COM> Date: Mon, 2-Nov-87 12:57:26 EST Article-I.D.: dataio.1407 Posted: Mon Nov 2 12:57:26 1987 Date-Received: Fri, 6-Nov-87 01:53:22 EST References: <1025@phoenix.Princeton.EDU> Reply-To: bright@dataio.UUCP (Walter Bright) Organization: Data I/O Corporation; Redmond, WA Lines: 19 Keywords: Sturctures records In article <1025@phoenix.Princeton.EDU> asjoshi@phoenix.UUCP (Amit S. Joshi) writes: $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 tend to do things like: struct { union b { struct c { int d,e; }}} s; #define d b.c.d for many of the leaf members, which greatly reduces the 'noise' typing. I also frequently have complicated structs that have unions and pointers to other structs in them, and I am constantly modifying the structure. Since I rarely modify the purpose of the leaf members, usually only the #define needs to be edited.