I have seen some declaration of a union inside a struct as follows. Example code given below.
My questions is does it help in any memory savings(typical use for which a union is used for)? I do not see the benefit.
typedef struct
{
int x1;
unsigned int x2;
ourstruct1 ov1;
ourstruct1 ov2;
union
{
struct
{
mystruct1 v1;
mystruct2 v2;
mystruct3 v3;
int* ctxSC;
mystruct4 v4;
Bool v5;
Long v6;
Long v7;
Long v8;
Long v9;
}mystr;
};
}structvar1;
-AD