[c++] How do I convert between big-endian and little-endian values in C++?