language agnostic - How can I discover whether my CPU is 32 or 64 bits? -


How do I know if my processor is 32 bit or 64 bit (in my own language of choice)? I want to know it for both Intel and AMD processors.

Windows, C / C ++:

  #include & Lt; Windows.h & gt; 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: // Break something else; }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -