Example code for structures and unions in c:
What is the output of below C program?
assume that int size is 4 bytes.
int eno, esal;
int tno, tsal;
struct Emp e1;
struct Trainer t1;
it gives compile time error.
both the structures have size of 8 bytes. but when we declare two structure variables in an union, space will be allocated to biggest of them, so it allocates only 8 bytes.
Back To Top