title: c++ treat the address location as an integer
body: <p>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</p>
  
  <pre><code>int i= 20;
  </code></pre>
  
  <p>and we know that for example, the location of the variable i is 0x77C79AB2.
  e.g. </p>
  
  <pre><code>int * ip = &amp;i;
  </code></pre>
  
  <p>so we know that ip = 0x77C79AB2.</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <pre><code>int a = 0x77C79AB2;
  </code></pre>
  
  <p>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.</p>
  
  <p>e.g.</p>
  
  <pre><code>int b = a + 0x20 =  0x77C79AB2 + 0x20 = 0x77C79AD2
  </code></pre>
  
  <p>Is this possible?
  How could I make this assignment ?</p>