title: Reverse changes to int after DMA
body: <p>Say I have the following variable initialized within a class:</p>
  
  <pre><code>class testClass {
  public:
      int someInt = 5;
  };
  </code></pre>
  
  <p>and I want to add to or modify it using like this:</p>
  
  <pre><code>int main() {
      testClass *t = new testClass;
      cout &lt;&lt; t-&gt;someInt &lt;&lt; endl;
      t-&gt;someInt = 1;
      cout &lt;&lt; t-&gt;someInt &lt;&lt; endl;
      delete t;
      cout &lt;&lt; t-&gt;someInt;
  }
  </code></pre>
  
  <p>How can I revert the changes done by the <code>t-&gt;someInt</code> to <code>someInt</code> back to the initial declaration, of <code>int i = 5</code>?</p>
  
  <p>Also, when I call delete before <code>cout &lt;&lt; t-&gt;someInt</code> still exists. Why does the output of <code>t-&gt;someInt</code> still equals <code>1</code>? Shouldn't it have been deleted?</p>
  
  <p>I am working on a game where it has present variables and I want to dynamically change the variables, such as a score, when the player gets a point to release memory and allow the player to replay the game after the variables are reverted back. </p>