title: Recalling the previous value of a variable?
body: <p>I'm a little new to c++ and I hate running across situations where I need to store a previous value in another variable. So my question is, can I make a variable in a sense store two values. I wish I could have the ability to recall previously stored values and use them in other functions.</p>
  <p>ex)
  Current way</p>
  <pre><code>int x1 = 5;
  int x2 = x1 + 5;
  int diff = x2 - x1;
  </code></pre>
  <p>What I want to do</p>
  <pre><code>int x = 5;
  x = x + 5;
  int diff = x - old_x;
  </code></pre>