开发者

printing all hex digits in c

开发者 https://www.devze.com 2023-01-12 17:18 出处:网络
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?

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

精彩评论

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

关注公众号