I'm working with the ZeroMQ library which uses void * to represent blocks of arbitrary binary data. However I'd like to use std::vector to copy and move these blocks around. What is the preferred, idiomatic way to make a std::vector representing raw bytes? I'm currently using a std::vector<unsigned char> but I want to make sure my code makes sense to other people.
Either
std::vector<unsigned char>
or
#include <cstdint>
std::vector<std::uint8_t>
both seem fine to me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With