title: How to store and get previously calculated value
body: <p>I am new to C++. I have making a code to calculate Value but I am unsure to about how to get the previously calculated value, which it has calculated in last call. In my understanding a way to do so is store values in array, but I am unsure about the exact structure/way to do so. Thanks in advance.</p>
  
  <pre><code>double CalculateValue(Node* node)
  { 
  float gamma=0.3;
  double Value = 0.0;
  
  Value = ((1-gamma)* previousValue)+ gamma); // how to get this previous value
  if (Value &gt; previousValue)
  </code></pre>