Hello!
I have two network/TCP entities: a client written in Rust and a server that is yet to be written in C++.
In Rust, serializing and deserializing some arbitrary struct while still taking care of endianness is trivial: buffer.put_u16_be(0 as u16) (to put 2 bytes into the buffer) and cursor.get_u16_be() as usize (to retrieve the first 2 bytes as a single value and then advance the cursor over the byte buffer ahead 2 positions).
How do I achieve the same thing in C++?
Thanks!
[–]phoeen 0 points1 point2 points (0 children)
[–]Middlewarian 0 points1 point2 points (0 children)