bhaveen kumar
Last Activity: 11 Years ago
Unions allow the same area of memory to be accessed as different data types. The insurance example above would not work.
Unions are useful (often in embedded programming) when it is needed to refer to a data item as two or more different types: e.g. it may be used as an integer for math, but an array of bytes for a serial transmission or a checksum calculation.