Unions are moderately useful in C and largely useless in C++. … Yes, there are other solutions to the same problem (mainly casting between pointer types), but unions are often cleaner and better self-documenting.
Unions are moderately useful in C and largely useless in C++. … Yes, there are other solutions to the same problem (mainly casting between pointer types), but unions are often cleaner and better self-documenting.