开发者

How to convert arbitory hex to ascii in c?

How to convert 00000000004004d8 to asci开发者_如何学Goi string?

E.g., 41 is for A?


I would use sscanf to do that. Something like:

char c[8];
sscanf("00000000004004d8", "%02x%02x%02x%02x%02x%02x%02x%02x", 
   &c[0],
   &c[1],
   &c[2],
   &c[3],
   &c[4],
   &c[5],
   &c[6],
   &c[7]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜