c++中检测系统是32位还是64位的方法如下: 1、定义一个函数getWindowsBit,传入布尔值: bool getWindowsBit(bool & isWindows64bit) { 预编译语句,判断32位成立,那么就把isWindows64bit置为true #if _WIN64 isWindows64bit = true; return true; 预编译语句,判断32位成立,那么就把isWow64置为false #elif _WIN32 BOOL isWow64 = FALSE; //IsWow64Process is not available on all supported versions of Windows. //Use GetModuleHandle to get a handle to the DLL that contains the function //and GetProcAddress to get a pointer to the function if available.