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
Thanks Brian. I wasn't aware that iostream would do that. You're right, uint8_t is big enough, iostream just prints out the extendend ASCII char rather than the int on std::cout. This works: void process_uint8_t( const std::string& bytes ) { const boost::uint8_t * data_ptr; boost::uint8_t data; data_ptr = reinterpret_cast<const boost::uint8_t*>(bytes.data()); data = *data_ptr; // print ascii std::cout << data << "," << sizeof(data) << std::endl; // print int std::cout << (unsigned int)data << "," << sizeof(data) << std::endl; } Thanks for pointing that out. Brad