#include #include #include #include #include int main() { std::string l { "125" }, r { "1233" }; uint32_t x = 0, y = 0; memcpy(&x, l.data(), 3); memcpy(&y, r.data(), 4); auto bx = bswap_32(x); auto by = bswap_32(y); fmt::println("{} {} {}\n", l > r, x > y, bx > by); }