title: variable from a for loop into another loop
body: <p>I have this c++ code for my uni project...</p>
  
  <pre><code>for (int a=0; a&lt;definedgroups; a++)
  {
      cout &lt;&lt; "Enter Lower number for group " &lt;&lt; a &lt;&lt; ": "; 
      cin &gt;&gt; User_Groups [a] [0] ;
  
  }
  </code></pre>
  
  <p>Now I want to declare another loop that displays the number </p>
  
  <p>could I use A from the first variable and say...</p>
  
  <pre><code>while (a&gt;0)
  {
  displays code, have written yet
  }
  </code></pre>
  
  <p>or is that "a" only recognised in that first for loop.</p>
  
  <p>Thanks</p>