Why do we need C Unions?
Unions are often used to convert between the binary representations of integers and floats: union { int i; float f; } u; // Convert floating-point bits to integer: u.f = 3.14159f; printf(“As integer: %08x\n”, u.i); Although this is technically undefined behavior according to the C standard (you’re only supposed to read the field which was … Read more