Can a pointer point to an address after 4GB?

Viewed 893

If we compile and execute the code below:

int *p;
printf("%d\n", (int)sizeof(p));

it seems that the size of a pointer to whatever the type is 4 bytes, which means 32 bit, so 232 adresses are possible to store in a pointer. Since every address is associated to 1 byte, 232 bytes give 4 GB.

So, how can a pointer point to the address after 4 GB of memory? And how can a program use more than 4 GB of memory?

3 Answers
Related