title: C++ Initialize Static Array
body: <p>I am not sure that this is even possible. From all the examples I have seen, the array is defined within the <code>{ }</code> brackets, but in my case it is not much possible.</p>
  
  <p>What I am trying to do is keep this in my drawing function to draw multiple circles that slowly increase in size. </p>
  
  <p>What I am getting by using a debugger is the static array is being reset every time the loop hits.</p>
  
  <p>I have also tried something like <code>static Rect rc[5] = {}</code></p>
  
  <pre><code>void fun_called_every_five_seconds() {
       static Rect rc[5];
  
       for (int i = 0; i &lt; count; i++) {
           int x = rand()%400;
           int y = rand()%400;
           int r = rand()%200;
           rc[i] = Rect (x,y,r,r);
       }
  
       rc[0].X += 50;
  
  
       // I check value of rc[0].X right here
   }
  </code></pre>