Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
How to check if a 64-bit project is...

How to check if a 64-bit project is being built in Visual Studio using #ifdef

Feb 05 2011
Author:

You may easily do it using #define preliminarily defined in the compiler. The following is the code that shows in what mode a project is being built – 32-bit mode or 64-bit mode (AMD64 or Intel 64) or in Itanium mode.

#if defined _M_IX86
      cout << _T(" (x86)");
#elif defined _M_X64
      cout << _T(" (x64)");
#elif defined _M_IA64
    cout << _T(" (Itanium)");
#endif

References

Popular related articles


Comments (0)

Next comments next comments
close comment form