On Sun, 10 Aug 2003, Serassio Guido wrote:
> gcc uses "ll" as 64 bit formatting prefix for printf, where MSVC uses "I64".

In C++, as Robert said, using operator<< would be better.

In standard C (C99), the way to handle this is to include <inttypes.h>
to get definitions of PRId64 and friends.  Then you do stuff like this:

    int64_t foo;
    printf("foo=%"PRId64"\n", foo);

If your compiler or system library doesn't supply the PRIxxx macros that
are supposed to be in <inttypes.h>, then you could define them somewhere
conditional on the compiler or system.

--apb (Alan Barrett)

Reply via email to