Joined: 09 May 2003 Posts: 25952 Location: The netherlands
Posted: Mon Jan 23, 2012 7:02 am Post subject: MS C-compiler: printf and 8 byte hex
I have an 8 byte variable(UINT64) whose bytes exist out of "3b 00 01 80 ff ff ff ff "
How do I use printf to display ffffffff8001003b (%llx and %016llX do not work)
Edit: found it: %I64x _________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping
In case someone accidentally wanders here in the future..
As I told Dark Byte on IRC it's preferable to use %PRIx64 from inttypes.h header if it's available on your compiler (C99?), because displaying 64-bit integers is non-standard. On gcc it expands to %llx and on MSVC to %I64x. But in his case, inttypes wasn't available.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum