Format specifier for 'long long'

Viewed 85643

I declare a variable for a 64 bit counter as :

long long call_count;

What is the format specifier that I should use in print statements?

I tried, %l, %ld, %ll. None seems to be correct.

I use Diab C compiler for compiling my application code to run on pSOS operating system.

7 Answers

According to C99, it should be "%lld" (see, for example,here). If Diab C isn't C99, then you'd have to look at the compiler docs, which I can't seem to find online with a quick Googling.

It's "%lli" (or equivalently "%lld")

Microsoft and Watcom use %I64d (capital eye), others use %lld (lowercase ell ell).

Maybe %lld? I think this is the format for gcc, don't know anything about Diab C compiler.

It is %lld for signed and %llu for unsigned

Related