函数char2Hex() - socketref,再见!高德 - C++博客
string Char2Hex(char a)
{
string str = "";
int n = a;
for (int i=2*sizeof(char) - 1; i>=0; i--)
{
str += "0123456789ABCDEF"[((n >> i*4) & 0xF)];
}
return str;
}
函数char2Hex() - socketref,再见!高德 - C++博客
string Char2Hex(char a)
{
string str = "";
int n = a;
for (int i=2*sizeof(char) - 1; i>=0; i--)
{
str += "0123456789ABCDEF"[((n >> i*4) & 0xF)];
}
return str;
}