What printf format specifier can be used to print a 64-bit unsigned integer in 32/64 bit hex notation and Windows / POSIX? The closest I've seen is %llX , but I'm not sure if it's portable enough. Answers that are ignored by older compilers (e.g. Visual Studio 2010) are acceptable.
%llX
The PRIx64 macro in <inttypes.h> is what you are looking for.
PRIx64
<inttypes.h>
This is a text token, so you can use it like: fprintf(stdout, "answer = %"PRIx64"\n", val);
fprintf(stdout, "answer = %"PRIx64"\n", val);
Since you specify %llX , you probably want to have uppercase letters; use: PRIx64
You can use the PRIx64 or PRIX64 (for unsigned uppercase hexadecimal integer ) defined in the <inttypes.h> header.
PRIX64 (for unsigned uppercase hexadecimal integer )
Source: https://habr.com/ru/post/1232122/More articles:Display last tag in commit with multiple tags - gitSending a POST request using JSONArray using Volley - jsonNo module named sql_server.pyodbc.base - pythonXamarin.Auth iOS9 SSL Authentication ERROR - facebookDBSCAN cosine metric error in python - scikit-learnSelect initial value not set in AngularJS - angularjsObjective-C method signatures match after Swift conversion - iosMongo embedded document request - pythonRandom exit differs from implementations - c ++Error: glBufferData using Cordoba - androidAll Articles