title: "i" not available in current context
body: <p>I am trying a debugging tool for the first time and I came up to the following problem:</p>
  
  <p>When I go step by step through the code with a debugger, and when I step into function <code>ComputeInterest()</code> and put watch on <code>i</code> (mark <code>i</code> and right click on it), watch informs me that </p>
  
  <blockquote>
    <p>'i' is not available in current context</p>
  </blockquote>
  
  <p>I'm also curious why watch didn't already put <code>i</code> into local variables. This is my code: </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  double computeInterest (double base_val, double rate, int years)
  {
       double final_multiplier;
       for ( int i = 0; i &lt; years; i++ )
       {
            final_multiplier *= (1 + rate);
       }
       return base_val * final_multiplier;
  }
  
  int main ()
  {
       double base_val;
       double rate;
       int years;
       cout &lt;&lt; "Enter a base value: ";
       cin &gt;&gt; base_val;
       cout &lt;&lt; "Enter an interest rate: ";
       cin &gt;&gt; rate;
       cout &lt;&lt; "Enter the number of years to compound: ";
       cin &gt;&gt; years;
       cout &lt;&lt; "After " &lt;&lt; years &lt;&lt; " you will have " &lt;&lt; computeInterest( base_val, rate, years ) &lt;&lt; " money" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I'm using the latest version 13.12 of Code:Blocks, g++ (GCC) 4.8.1 and GNU gdb (GDB) 7.6.1.</p>