FAQs about visual C ++ 64-bit migration
Visual Studio 2012In other versions, this topic has not been rated.-comment on this topic.
When using Visual C ++ to create an application running in a 64-bit Windows operating system, pay attention to the following issues:
In 64-bit windows, int and long are 32-bit values. Do not assign pointers to programs planned to be compiled on the 64-bit Platform
32-bit variable. On the 64-bit platform, the pointer is 64-bit. if the pointer is assigned to a 32-bit variable, the pointer value should be truncated.
In a 64-bit Windows operating system,Size_t,Time_tAndPtrdiff_tIs a 64-bit value.
In the 32-bit Windows Operating System Visual C ++ version earlier than visual C ++ 2005,Time_tIs a 32-bit value. By default,Time_tIt is a 64-bit integer. For more information, see time management.
Pay attention to where the code uses the int value and uses itSize_tOrTime_tValue processing. Numbers may grow larger than 32 digits, and data may be truncated when transferred back to int storage.
% X (hexadecimal int format)PrintfModifiers do not work as expected in 64-bit windows. It only performs operations on the first 32-bit value of the value passed to it.
Windows 32-bit OS uses % i32x to display integers.
Windows 64-bit OS uses % i64x to display integers.
% P (The hexadecimal format of the pointer) works as expected in a 64-bit Windows operating system.
For more information, see:
Compiler Options
/Wp64
_ W64
Migration prompt
See
Programs with 64-bit configurations for other resources (Visual C ++)