View Single Post
Old 2009-10-01, 02:14   #7
grandpascorpion
 
grandpascorpion's Avatar
 
Jan 2005
Transdniestr

1111101112 Posts
Default

Quote:
Originally Posted by jasonp View Post
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
Code:
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);
Ugly but portable :) . Thanks.
grandpascorpion is offline   Reply With Quote