char *buf;
...
for (i=0; i<buf_size; i++)
printf("%02x ", buf[i] & 0xff);
or
unsigned char *buf;
...
for (i=0; i<buf_size; i++)
printf("%02x ", buf [i]);
這是我的工作酸甜苦辣,與大家分享,希望彼此都有收穫:) This is my working experience in my life. It is good to share with you :)
char *buf;
...
for (i=0; i<buf_size; i++)
printf("%02x ", buf[i] & 0xff);
unsigned char *buf;
...
for (i=0; i<buf_size; i++)
printf("%02x ", buf [i]);