I have not understood exactly what you want. But maybe you need something as
1 2 3 4 5 6 7 8 9 10 11
|
{
std::string s = "This is a test";
for ( std::string::size_type i = 0, len = s.length() ; i < len ; i++ )
{
std::cout << std::hex << ( int ) s[i];
if ( i % 8 == 7 ) std::cout << std::endl;
else if ( i % 4 == 3 ) std::cout << ' ';
}
std::cout << std::endl;
}
|
Last edited on
Thank you everyone for the help. Volatile's example is exactly what I was looking for.
Thanks again for all the help! :D