I want to know if there is anyway that I can store the address location of a variable as an integer value. For example, let's say that I have a number stored in some location in memory
int i= 20;
and we know that for example, the location of the variable i is 0x77C79AB2. e.g.
int * ip = &i;
so we know that ip = 0x77C79AB2.
But at this point the variable ip is just a pointer. But let's say that I now want to store the address location 0x77C79AB2 into a variable of type int (NOT of type Pointer).
so, somehow I want to be able to make another variable of type (int) to actually store the number 0x77C79AB2 as a value not as a address location.
int a = 0x77C79AB2;
So, I could do whatever I want with the variable a. For example, I want to treat a as an integer and add a hex number 0x20 to it.
e.g.
int b = a + 0x20 = 0x77C79AB2 + 0x20 = 0x77C79AD2
Is this possible? How could I make this assignment ?