将16进制字符串转换为16进制数的例程
工作中遇到了该问题,回家参考一篇文章实验了下,是可以的:
root@xiangpingli:/home/linux/Desktop/samba/exercise/build# ../binary/strtohex ------------------------------------------0x110x11------------------------------------------hwid:00112233445566778899aabbccddeefftmp:0x00hwidhex[i/2]:0tmp:0x11hwidhex[i/2]:11tmp:0x22hwidhex[i/2]:22tmp:0x33hwidhex[i/2]:33tmp:0x44hwidhex[i/2]:44tmp:0x55hwidhex[i/2]:55tmp:0x66hwidhex[i/2]:66tmp:0x77hwidhex[i/2]:77tmp:0x88hwidhex[i/2]:88tmp:0x99hwidhex[i/2]:99tmp:0xaahwidhex[i/2]:aatmp:0xbbhwidhex[i/2]:bbtmp:0xcchwidhex[i/2]:cctmp:0xddhwidhex[i/2]:ddtmp:0xeehwidhex[i/2]:eetmp:0xffhwidhex[i/2]:ff------------------------------------------hwid:00112233445566778899aabbccddeefftmp:0x00hwidhex[i/2]:0tmp:0x11hwidhex[i/2]:11tmp:0x22hwidhex[i/2]:22tmp:0x33hwidhex[i/2]:33tmp:0x44hwidhex[i/2]:44tmp:0x55hwidhex[i/2]:55tmp:0x66hwidhex[i/2]:66tmp:0x77hwidhex[i/2]:77tmp:0x88hwidhex[i/2]:88tmp:0x99hwidhex[i/2]:99tmp:0xaahwidhex[i/2]:aatmp:0xbbhwidhex[i/2]:bbtmp:0xcchwidhex[i/2]:cctmp:0xddhwidhex[i/2]:ddtmp:0xeehwidhex[i/2]:eetmp:0xffhwidhex[i/2]:ff
参考文章:
http://blog.csdn.net/ixidof/article/details/6081217