View Single Post
Old 2009-10-01, 01:26   #6
Tribal Bullet
jasonp's Avatar
Oct 2004

354510 Posts

If you include inttypes.h, you get macros to insert into format strings that will print 64-bit values correctly. On my mingw installation they are
inttypes.h:#define PRId64 "I64d"
inttypes.h:#define PRIi64 "I64i"
inttypes.h:#define PRIo64 "I64o"
inttypes.h:#define PRIu64 "I64u"
inttypes.h:#define PRIx64 "I64x"
inttypes.h:#define PRIX64 "I64X"
Admittedly it makes the format string painful to write, i.e.

printf("I have computed %" PRId64 "\n", answer);

Last fiddled with by jasonp on 2009-10-01 at 01:28
jasonp is offline   Reply With Quote