How to know architecture of windows using c++

Hello i did one small program to check my architecture of windows using c++:
1
2
3
4
5
6
7
8
9
10
11
#if_WIN64
 isWow64=true;

#elif_WIN32
 isWow64=false;

if(isWow64==true){
 windows="Windows64bits";
}else{
 windows="Windows32bits";
}


But i am not sure if this check the version of windows or my application. And the other thing is using isWow64 returning true or false i'm doing well to get the correct architecture of windows?
Last edited on
An #if/#elif chain must be ended with an #endif. You also need to add some spaces to separate the macro names.

1
2
3
4
5
#if _WIN64
 isWow64=true;
#elif _WIN32
 isWow64=false;
#endif 
There's two problems:
1. Like you suspect, what you're checking only tells you how your program was compiled, not the bitness of the system.
2. The bitness of the system and whether the current process is a WOW64 process are two separate questions. If the current process is WOW64 then you know the system is 64-bit, but if it's not WOW64, the system could still be either platform.
Topic archived. No new replies allowed.