How do I find out if my processor is 32 bit or 64 bit (in your language of choice)? I want to know this for both Intel and AMD processors.
In Windows 10, go to Settings > System > About or type About in the Windows 10 search box. Under the Device specifications heading, you'll see it at System type: "64-bit operating system, x64-based processor" means you're covered.
Windows, C/C++:
#include <windows.h>
SYSTEM_INFO sysInfo, *lpInfo;
lpInfo = &sysInfo;
::GetSystemInfo(lpInfo);
switch (lpInfo->wProcessorArchitecture) {
case PROCESSOR_ARCHITECTURE_AMD64:
case PROCESSOR_ARCHITECTURE_IA64:
// 64 bit
break;
case PROCESSOR_ARCHITECTURE_INTEL:
// 32 bit
break;
case PROCESSOR_ARCHITECTURE_UNKNOWN:
default:
// something else
break;
}
C#, OS agnostic
sizeof(IntPtr) == 4 ? "32-bit" : "64-bit"
This is somewhat crude but basically tells you whether the CLR is running as 32-bit or 64-bit, which is more likely what you would need to know. The CLR can run as 32-bit on a 64-bit processor, for example.
For more information, see here: How to detect Windows 64-bit platform with .NET?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With