Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!interlan!deem From: deem@interlan.UUCP (Mike Deem) Newsgroups: comp.lang.c Subject: I'd like to . . . Message-ID: <511@interlan.UUCP> Date: Wed, 11-Nov-87 12:22:47 EST Article-I.D.: interlan.511 Posted: Wed Nov 11 12:22:47 1987 Date-Received: Fri, 13-Nov-87 22:57:37 EST References: <10224@brl-adm.ARPA> <6660@brl-smoke.ARPA> Reply-To: deem@interlan.UUCP (Mike Deem) Organization: MICOM-Interlan, Boxborough, MA (1-800-LAN-TALK) Lines: 36 Here is another "I'd like to be able to do this in C" suggestion. There are times I would like to be able to say: s.a = 4321; . . . s.b = 123.4; where a and b occupy the same memory but s is a structure and has other feilds, say c and d, that could be accessed by: s.c and s.d I think this could be declared something like: struct { int c; /* c takes up space */ union { /* no identifier */ int a; /* both a and b are in the same space and */ float b; /* that space follows c's */ }; /* no identified here either */ char d; /* d takes space following the a b space */ } s; I know I could give the union a name, say u, and write: s.u.a but when s u and a are replaced with "meaningful" identifiers or many structures are nested, things get to long.