+ 1

Difference between Structure and Union ?

At least 5 Points ?

11th May 2017, 10:05 AM
Divyansh Sharma
Divyansh Sharma - avatar
1 Réponse
+ 1
struct stores values next to each other. union stores everything on 1 address. both use padding bits if some values dont fit. e.g. a struct with 4 ints uses 256 bit (4*32) an union with an int, a short array with 2 elements and a byte array with 4 elements uses 32 bit. guess what this can be used for...
11th May 2017, 10:14 AM
Peter