On Thu, Jul 14, 2016 at 12:15 PM, Viral Mehta <
vira...@gmail.com> wrote:
> #include <stdio.h>
> struct inside {
> int a;
> char b;
> int c;
> };
>
> struct bigger {
> struct inside in;
> int d;
> };
If the members declared in "bigger" structure is shuffled (order of
declaration is changed),
it may not work.
Is that what you were looking for?
> union outside {
> struct inside in;
> struct bigger big;
> };
>
> int main()
> {
> union outside out;
>
> out.big.in.a = 9; //ASSIGN TO BIG
> out.big.in.b = 'a';
> out.big.in.c = 10;
> out.big.d = 11;
>
> //GET IT FROM SMALL
> // WILL THIS ALWAYS WORK ???
> printf(" %d : %c : %d : %d\n", out.in.a, out.in.b, out.in.c,
> out.big.d);
>
>
> }
>
>
> --
> Thanks,
> Viral Mehta
>
> --
> -- Owner of this group do not accept ANY liability for the views expressed
> in the email or for the consequences of any computer viruses that may be
> transmitted with this email. Owner is not responsible for any kind of
> copyright violations or infringements caused/posted by any user of the
> group. Messages are posted through moderation also does not include any kind
> of verification against copyright violations or infringements.
> ---
> You received this message because you are subscribed to the Google Groups
> "insane" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
fundamental-discu...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.