title: C++ set memory address to value
body: <p>I am currently making 2 programs. One of them will set a value, display the memory value and the value of the variable. Next it will wait for the user to press enter and it will show the value again. The next program will set the memory address directly, therefore modifying the value in the other code.</p>
  
  <p>Here is my pointer1.cpp file:</p>
  
  <pre><code>  1 #include "iostream"
    2 using namespace std;
    3 
    4 
    5 
    6 int main()
    7 {
    8     int x = 100;
    9     cout &lt;&lt; "The memory of \"x\" is " &lt;&lt; &amp;x &lt;&lt; ". X = " &lt;&lt; x &lt;&lt; endl;
   10     cin.get();
   11     cout &lt;&lt; x &lt;&lt; endl;
   12 }
  </code></pre>
  
  <p>An example output is:</p>
  
  <pre><code>The memory of "x" is 0x7fff578589ac. X = 100
  
  100
  </code></pre>
  
  <p>How would I then be able to make my second application to modify the memory address <code>0x7fff578589ac</code>?</p>
  
  <p>Thanks.</p>