I am trying to print out an unsigned long long
like this:
printf("Hex add is: 0x%ux ", hexAdd);
but I am getting type conversion errors since I have an unsigned long long
.
c++integerprintf
I am trying to print out an unsigned long long
like this:
printf("Hex add is: 0x%ux ", hexAdd);
but I am getting type conversion errors since I have an unsigned long long
.
Best Answer
You can use the same
ll
size modifier for%x
, thus:The full range of conversion and formatting specifiers is in a great table here:
printf
documentation on cppeference.com