Thursday, October 18, 2007

string in hex

Sometimes, I need to see characters of a string in Hex values:

void printhex(unsigned char* str)
{
    for (int j=0;j<strlen(str);j++)
        printf("%02X ", str[j] );
}


No comments:

Post a Comment