sprintf for unsigned _int64

I don’t know what POSIX has to say about this, but this is nicely handled by core C99: #include <stdio.h> #include <inttypes.h> int main(void) { uint64_t dbFileSize = 99; uint64_t fileSize = 100; char buf[128]; memset(buf, 0x00, 128); sprintf( buf, “\nOD DB File Size = %” PRIu64 ” bytes \t” ” XML file size = … Read more

Is C++11’s long long really at least 64 bits?

The C++ standard references the C standard for this, see [c.limits]. LLONG_MAX is defined in <climits> with the same meaning as C’s <limits.h>‘s LLONG_MAX. And this is what C has to say: 5.2.4.2.1 Sizes of integer types <limits.h> The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives. … Read more