开发者

How to convert arbitory hex to ascii in c?

开发者 https://www.devze.com 2023-02-25 01:43 出处:网络
How to convert 00000000004004d8 to asci开发者_如何学Goi string? E.g., 41 is for A?I would use sscanf to do that. Something like:

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

精彩评论

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