Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The Output Method of Long Integer in C Language under windows and linux
The Output Method of Long Integer in C Language under windows and linux
I can provide an idea, and you can decide for yourself whether it is feasible: if it is a simple output, you can convert this integer into a string, and then output it in the operating system by string output. In addition, there are some differences between different compilers.

Longlong is actually an int64 type. In winnt.h, you can see:

typedef _ _ int64 LONGLONG

So if you want to output, it depends on what format character __int64 uses. By checking MSDN, it is found to be: I64.

In the print format, you need to combine a d, that is, %I64d. For unsigned ULONGLONG, it is %I64u.