
On Sun, Feb 5, 2012 at 7:06 AM, Brad Tilley
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
(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
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
What doesn't work about it? The std iostreams print char types as (extended) ascii characters. What if you cast the type to a wider integer just when printing? Brian