Variable definition |
Output mode |
GCC (MINGW32) |
g++ (MINGW32) |
GCC (Linux i386) |
g++ (Linux i386) |
MicrosoftVisual C + + 6.0 |
Long Long |
"%lld" |
Error |
Error |
That's right |
That's right |
Cannot compile |
Long Long |
"%i64d" |
That's right |
That's right |
Error |
Error |
Cannot compile |
__int64 |
"%lld" |
Error |
Error |
Cannot compile |
Cannot compile |
Error |
__int64 |
"%i64d" |
That's right |
That's right |
Cannot compile |
Cannot compile |
That's right |
Long Long |
cout |
Non-C + + |
That's right |
Non-C + + |
That's right |
Cannot compile |
__int64 |
cout |
Non-C + + |
That's right |
Non-C + + |
Cannot compile |
Cannot compile |
Long Long |
Printint64 () |
That's right |
That's right |
That's right |
That's right |
Cannot compile |
These five compilers were GCC (mingw32), g++ (MINGW32), GCC (Linux i386), g++ (Linux i386), and Microsoft Visual C + + 6.0. Unfortunately, there is no combination of definitions and outputs that are compatible with these five compilers . To get a thorough understanding of the different compilers for 64-bit integers, I wrote the program to evaluate them, as shown in the table above.
Support for 64-bit integers for the five common C + + compiler types