In C++ you can use the size of a pointer to work out what sort of process you're running in:
bool is_64_bit()
{
return sizeof(void *) == 8;
}
This has got the advantage of being portable and you don't have to call any OS functions.
You can do something similar in C - just return an
int
instead.