Flag Discuss with colleagues and IITians> C...
question mark

What is the use of UNIONS in C ?

P V V Satyanarayana , 12 Years ago
Grade Upto college level
anser 1 Answers
bhaveen kumar

Last Activity: 12 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.

star
LIVE ONLINE CLASSES

Prepraring for the competition made easy just by live online class.

tv

Full Live Access

material

Study Material

removal

Live Doubts Solving

assignment

Daily Class Assignments