
5 Feb
2012
5 Feb
'12
3:06 p.m.
I can make the cast work by storing it in a uint16_t or larger type: void process_uint8_t( const std::string& bytes ) { const boost::uint16_t * data_ptr; boost::uint16_t data; data_ptr = reinterpret_cast<const boost::uint16_t*>(bytes.data()); data = *data_ptr; std::cout << data << "," << sizeof(data) << std::endl; } I thought this would work in a uint8_t as well, but it doesn't. Thanks, Brad