Hacker News new | ask | show | jobs
by stephencanon 3827 days ago
The usual way to do this via memcpy, rather than either a union (requires some non-portable extension like "packed") or pointer casting (invokes undefined behavior if alignment isn't satisfied).