16进制转换成字符串
摘要:
inline int hex_to_str(const unsigned char *hex, int hexlen, char *str, int &strlen){ int outhexlen = hexlen * 2 + 1; if (strlen < outhexlen) { return -1; } strlen = outhexlen; for (int i = 0; i < hexlen; ++i) { _snprintf(str + 2*i, 3, "%02X", (unsigned char)hex[i]); } return strl 阅读全文
posted @ 2014-02-20 16:56 hgy413 阅读(447) 评论(0) 推荐(0) 编辑