开发者

printing all hex digits in c

if i have long long number with zeros before the number like this 0x000000000076fba1 how do i print the number with a开发者_如何学Cll the zeros? cuse when i tried to print the numb its writs 0x76fba1.

thank you!


long long unsigned n = 0x000000000076fba1;
printf("%0x0.16llx\n", n);


#ifdef __int64   
printf("%#018I64x\n", n); /* for MSVC+MinGW */
#else
printf("%#018llx\n", n);  /* other compiler with "unsigned long long" support */
#endif
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜