title: Difference between variables inside the function and variables functioning as arguments in C++
body: <p>My question comes from <a href="https://stackoverflow.com/questions/17214780/proper-way-of-designing-functions-with-and-without-debug-information-in-c">Proper way of designing functions with and without debug information in C++</a>. I want to compare the efficiency of the following functions:</p>
  
  <p>Function 1</p>
  
  <pre><code>bool my_func1(int arg1, int &amp;output, std::vector&lt;int&gt; &amp;intermediate_vec);
    {
       // do something
    }
  </code></pre>
  
  <p>When I use this function, I will invoke it in the following way:</p>
  
  <pre><code>int arg;
  int output;
  std::vector&lt;int&gt; intermediate_vec;
  my_func1(arg,output,intermediate_vec);
  </code></pre>
  
  <p>Function 2</p>
  
  <pre><code>  bool my_func2(int arg1, int &amp;output);
    {
  
      std::vector&lt;int&gt; intermediate_vec
      return my_func1(arg1, output, intermediate_vec);
    }
  </code></pre>
  
  <p>When I use this function, I will invoke it in the following way:</p>
  
  <pre><code>int arg;
  int output;
  my_func2(arg,output);
  </code></pre>
  
  <p>My question is: are these two functions of the same efficiency? </p>