Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to output 64-bit integers in C language programming
How to output 64-bit integers in C language programming
There are no 64-bit integer types in 1 and ANSI C99 standards. However, many actual compilers support 64-bit integer types. Because there is no standard in this respect, the specific grammatical description method is slightly different. General Windows platform uses the keyword __int64, and Linux platform uses the description of long long.

2. Someone has done the test, as shown in the following figure:

According to the above figure, the following points can be drawn:

A: long long definition can be used for gcc/g++ and is not limited by the platform, but it cannot be used for VC6.0.

B:__int64 is a 64-bit long integer defined by Win32 platform compiler, and cannot be used for Linux.

C: "%lld" is used for Linux i386 platform compiler and "%I64d" is used for Win32 platform compiler.

D:cout can only be used for C++ compilation. In VC6.0, cout does not support 64-bit long integers.

3. If you want to use 64-bit integers, try to use the latest compilers and Windows platforms, and try to use newer versions of VS and Linux platforms. It is recommended to upgrade gcc/g++ to the latest version.