64-bit and 32-bit program configuration under VS2013

Source: Internet
Author: User

64-bit and 32-bit program configuration under VS201364-bit programs are generated under Windows 7 64bit and Visual Studio 2013.
    • Create a new visual Studio Win32 console project named WinTestX64.

The code is as follows

#include"stdafx.h"#include<iostream>using namespacestd;#definePRINT (a) cout << #a << ":" << a << EndlvoidPrintSize (Charainfunc[]) {PRINT (sizeof(Ainfunc));}int_tmain (intARGC, _tchar*argv[]) {    CharA[] ="ABC"; Char*b ="ABC"; PRINT (sizeof(a)); PRINT (sizeof(b));    PrintSize (a);    GetChar (); return 0;}

    • Click Solution Platforms on the toolbar, select Configuration Manager ..., and then select <New...> in Active solution platform

    • Select the "x64" platform in the "New Solution Platform" dialog box. Click OK.

    • Back to the IDE interface, notice that the platform is now x64.

    • Compile, link, generate 32-bit and 64-bit programs, respectively.

    • Press F5, start debugging, in the output dialog, we can see that the 32-bit and 64-bit programs load the DLLs differently. The 32-bit program loads the DLL from SysWOW64.

The 64-bit program loads the DLL from System32.

Compile with 32bit and 64bit configuration respectively to see the difference between the results.

64-bit and 32-bit program configuration under VS2013

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.