Type Punning

Type punning refers to techniques that are used to circumvent the type system. In the context of C and C++, it usually means reinterpreting bytes.

Differences in C and C++

In C, objects of two layout compatible types can be converted back and forth with each other. In C++, such conversions are usually UB and in some cases may not compile.