acces to nested struc/unit member

Thomas Kuehne thomas-dloop at kuehne.cn
Fri Dec 29 08:04:54 PST 2006


novice2 <sorry at noem.ail> schrieb:
> Hello. Could please anybody explain me syntax to access to nested
> structure/union members? In Windows API translated headers thearis
> situation - anonimous union nested in structure. This is minimal
> trivial extracted example:
>
> //dmd\html\d\struct.html: "anonymous structs/unions are allowed as
> members of other structs/unions"
>
> struct Stru
> {
>   int a;
>   union Uni 
>   {
>     int b;
>     int c;
>   };
> }

This union is named "Stru.Uni", it isn't anonymous.

The anonymous version is:
> struct Stru
> {
>   int a;
>   union
>   {
>     int b;
>     int c;
>   };
> }

Thomas


More information about the Digitalmars-d-learn mailing list