Example code for using union in c:
What is the output of below C program?
assume that int is 4 bytes, and float is 4 bytes in this machine.
when we use union, it allocates only one memory big enough to store any of the given element. so int & float both size is 4 bytes only. so it allocates 4 bytes for this variable s.
Back To Top