十六进制 字符打印

来源:互联网 发布:python服务器端开发 编辑:程序博客网 时间:2024/06/05 16:52

printf打印字符的十六进制格式,需要unsigned char转换一下
printf("[%02x]\n",(unsigned char)str[i]);
gdb打印16进制字符:p/x str[0]


unsigned char **specificInfoH;

        for(UINT32 i=0; i<specificInfo->size - bytesSkipped; i++)

             fprintf(stderr,  "%s:%d:%s,   tttttttttttt  specificInfoH[%d]=%02x  specificInfo->size - bytesSkipped=%d  bytesSkipped =%d  leosu   \n",__FILE__, __LINE__,__FUNCTION__, i, (unsigned char)(*(*specificInfoH + bytesSkipped+i)) , specificInfo->size - bytesSkipped , bytesSkipped);


1005 10:45:55.921 streamer(474) None: common/src/MP4Media.c:1168:MP4GetMediaDecoderInformation,   tttttttttttt  specificInfoH[0]=13  specificInfo->size - bytesSkipped=7  bytesSkipped =5  leosu   

0 0