You could use the type int64_t
, which is defined in the header cstdint
. This is standard as of C++11.
Note that this type might not exist if the platform you're using does not support 64 bit integers.
As for long long
, that is another possibility. long long
s are at least 64-bits wide. Note that it is standard as of C++11 as well, even though it will work on several compilers when using C++03.
As mentioned by Pete Becker, you could use int_least64_t
. This is a good choice if you don't mind using exactly 64 bit integers, but some integral type that is at least 64 bits wide.