A modern and standard solution is std::byteswap.

https://en.cppreference.com/w/cpp/numeric/byteswap

According to this https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B23_library_features

you will need llvm 14 for that.

A+

Paul




Reply via email to