title: Which is better, to define the variable inside the loop or outside, with huge loop times
body: <p>I need to use an array in a loop, and the loop time is very huge.</p>
  <p>Case 1: define the array outside the for-loop and pass it to <code>fun2</code></p>
  <pre><code>void fun1(){
      int temp[16];
      for(int i = 0;i &lt;times; i++)
      {
          fun2(temp);
      }       
  }
  
  void fun2(int[]&amp; temp){
      /**  do something with temp*/
  }
  </code></pre>
  <p>Case 2: define the array in <code>fun2</code>:</p>
  <pre><code>void fun1() {
      for (int i = 0; i &lt; times; i++)
      {
          fun2();
      }
  }
  
  void fun2() {
      int temp[16];
      /**  do something with temp */
  }
  </code></pre>
  <p><code>fun1</code> will be called very often. In this situation, which is better?</p>
  <p>Does Case 2 have some influence on performance?</p>