方法一:
#include <windows.h>
#include<iostream>
using namespace std;
BOOL is64bitSystem()
{
SYSTEM_INFO si;
GetNativeSystemInfo(&si);
if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
return TRUE;
return FALSE;
}
int main()
{
if (is64bitSystem())
cout << "The process is running under WOW64.\n";
else
cout << "The process is not running under WOW64.\n";
return 0;
}
方法二:
#include<iostream>
using namespace std;
int main()
{
void* p = 0;
cout << sizeof(p) * 8 << endl;
return 0;
}