So I need a little help, I've currently got a text file with following data in it:
myfile.txt ----------- b801000000 What I want to do is read that b801 etc.. data as bits so I could get values for
0xb8 0x01 0x00 0x00 0x00. Current I'm reading that line into a unsigned string using the following typedef.
typedef std::basic_string <unsigned char> ustring; ustring blah = reinterpret_cast<const unsigned char*>(buffer[1].c_str()); Where I keep falling down is trying to now get each char {'b', '8' etc...} to really be { '0xb8', '0x01' etc...}
Any help is appreciated.
Thanks.
unsigned charis still just one byte.