Måns Rullgård <> writes:
> writes:
>> what is format for sprintf to convert long long integer (64 bits) to
>> string?
>
> The format for "long long" is %lld (or %llx etc.). Keep in mind
> though, that a long long is not necessarily 64 bits. If you
> specifically need 64 bits, use the types defined in stdint.h and the
> format macros in inttypes.h.
And keep in mind that your runtime library's version of sprintf()
might not support "%lld". Mismatches between a compiler and the
runtime library it uses (for example, where the compiler supports
"long long", but sprintf() doesn't) are not uncommon.
Some older versions of sprintf() *might* use "%Ld" rather than "%lld".
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.