#include <windows.h>
#include <stdio.h>
#pragma comment(lib, "user32.lib")
int main(int argc, char *argv[])
{
SYSTEM_INFO si;
// Copy the hardware information to the SYSTEM_INFO structure.
GetNativeSystemInfo(&si);
// Display the contents of the SYSTEM_INFO structure.
printf("si.wProcessorArchitecture = %d\nPROCESSOR_ARCHITECTURE_AMD64 = %d\nPROCESSOR_ARCHITECTURE_IA64 = %d\n",
si.wProcessorArchitecture, PROCESSOR_ARCHITECTURE_AMD64, PROCESSOR_ARCHITECTURE_IA64);
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
{
printf("64-bit os\n");
}
else{
printf("32-bit os\n");
}
getchar();
return 0;
}
c判断windows的系统是32位还是64位
最新推荐文章于 2022-10-23 16:36:08 发布