   32/64 bit  question ..
  Hihow can i find whether my machine is 32bit or 64bit by my c++ code ..regardsy2jsave ??   
  If your code is 64-bit, then the machine must be 64-bit.If your code is 32-bit (Or 64-bit), you can use GetNativeSystemInfo (Assuming Win32), and check if the wProcessorArchitecture field is  PROCESSOR_ARCHITECTURE_AMD64 or PROCESSOR_ARCHITECTURE_IA64.EDIT: Or use IsWow64Process.   ;  What about asm: CPUID ?Works on any x86/64 complying CPU.CPUID.Edit: Then again, this won't predict the case where someone is running 32 bit OS on 64 bit system.   ;  actually , what i intend to ask was is there any c++ techniques which can tell us this ..i mean some program sort of thing ..regardsy2jsave   ;  No. Fundamentally, the language is (mostly) independent of the architecture, and it has no notion of "how many bits" the processor has.   ;  http://1code.codeplex.com/SourceControl/changeset/view/39074#842774   ;  sizeof(void *) should return 4 on x86 and 8 on x86_64edit: operating system, not hardware. IOW a 32bit OS running on 64bit CPU will still use 4-byte pointers.[Edited by - tori on June 2, 2010 2:29:29 PM];Quote:Original post by torisizeof(void *) should return 4 on x86 and 8 on x86_64Useless in practice. It will also return 4 if you are running a 32bit process on a 64bit OS through WOW64. It will only return 8 if you are running a native 64bit process. And well, in this case it's quite obvious you're on 64 bit, because otherwise your code wouldn't even execute.IsWow64Process is it.;  Is there any reason you want to find out from your code? Because in essence, you either compile a 32-bit or 64-bit executable and run that. It either runs on your CPU or it doesn't due to incompatibility. The only reason I can see why you want to figure it out is when you're writing an installer. Our installer package detects 64-bit machines and installs a 64-bit version of the application.   