Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!xanth!mcnc!ecsvax!uncw!session From: session@uncw.UUCP (Zack Sessions) Newsgroups: comp.lang.c Subject: Re: VMS extensions Keywords: VMS C Message-ID: <334@uncw.UUCP> Date: 6 Apr 89 14:50:39 GMT References: <1321@Portia.Stanford.EDU> Reply-To: session@uncw.UUCP (Zack Sessions) Distribution: na Organization: Math/Computer Science Department Lines: 51 Quoting the VAX-C manual: To illustrate the use of variant aggregates, consider the following code example which doe not use variant aggregates: /* the number on the right represents offsets */ struct TAG_1 { int a; /* 0 */ char *b; /* 4 */ union TAG_2 /* 8 */ { int c; /* 0 */ struct TAG_3 { int d; /* 0 */ int e; /* 4 */ } nested_struct; } nested_union; } enclosing_struct; To access nested member d you would have to use: enclosing_struct.nested_union.nessted_struct.d Using variant aggregates: struct TAG_1 { int a; char *b; variant_union { int c; variant_struct { int d; int e; } nested_struct; } nested_union; } enclosing_struct; Here to access d you would use: enclosing_struct.d To convert to non-variant aggregates it would seem like you would have to expand all references to any member in a variant aggregate to the full reference and use non-variant aggregates. Zack Sessions