I want to read a mac id from command line and convert it to an array of uint8_t values to use it in a struct. I can not get it to work. I have a vector of stri
uint8_t
I think you are using the std::hex in the wrong place:
#include #include int main() { std::string h("a5"); std::stringstream s(h); int x; s >> std::hex >> x; std::cout << "X(" << x << ")\n"; }