First I set its value to an integer that requires 64 bits:
uintptr_t val = 1.8e15;
When I tried to compile it I got an error that said "warning: overflow in implicit constant conversion".
Then I changed it so the variable holds a value that only requires 32 bits:
uintptr_t val = 1e9;
That compiled. So I am now pretty sure that pointer variables are 32 bits on my computer.
Now I'm wondering: If I were to install 3 more GB of RAM (since that would bring it over 4 GB, requiring 64 bit addresses), would the width of the pointer types change? Also, if I compile it on my machine with a limit of of 4 GB of RAM, and then someone runs it on a machine that has a 64 bit addressing scheme, will it still run without getting a bus error? I'm not sure if this is the best place to ask, because I'm asking a hardware-related question on a software development forum, but I just thought I'd give it a shot.


Sign In
Create Account


Back to top









