Support for 64-bit integers for the five common C + + compiler types

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.