Changes in the variable type of C/C ++ transplanted to 64-bit on Windows

Source: Internet
Author: User

Compile 64-bit program variable types on Windows:

Type: 32-bit compiled size: 64-bit compiled size
Char 1 1
Short 2 2
Int 4 4
Long 4 4
Pointer 4 8
Size_t 4 8
Some other types defined in Windows also change to 8 bytes, including wparam, lparam, and lresult.
It can be seen that there are not many types of changes. If the 64-bit switch is used for re-compilation, the changes made in Porting are relatively small.

On Unix/Linux platforms and Windows platforms,On UNIX platforms, the long type is also changed to 8 bytes..

If the 64-bit compilation switch is not used to re-compile the program, the program will remain the size of the original 32-bit, so there will be no porting changes.

 

Related Article

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.