unsigned long long type printing in hexadecimal format
try %llu
- this will be long long unsigned in decimal form
%llx
prints long long unsigned in hex
You can use the same ll
size modifier for %x
, thus:
#include <stdio.h>
int main() {
unsigned long long x = 123456789012345ULL;
printf("%llx\n", x);
return 0;
}
The full range of conversion and formatting specifiers is in a great table here:
printf
documentation on cppeference.com