title: How to change the value stored at an memory address
body: <p>I try to modify a value that is stored at a certain memory address.</p>
  
  <p>The address is stored in a certain pointer but altering it with a new int changes the memory address (of course).</p>
  
  <pre><code>int *toModify = (int *)(foo+5); //foo is a adress of a function. 
  //The val to alter is 5bytes after it
  int newVal = 5;
  toModify = &amp;newVal;
  
  
  //implementation of foo
  int foo(){
  return 42;
  }
  </code></pre>
  
  <p>Lets say toModify has value 42. I want to change it to 5.
  How can I achieve to store the change in the address of toModify?</p>