title: Will a variable go out of scope when the function returns?
body: <pre><code>void main()
  {
      File f;
      DoSomething(f);
      DoSomething2(&amp;f);
  }
  
  void DoSomething(File&amp; f)
  {
      f.Process();
  } // will f go out of scope when this function returns?
  
  void DoSomething2(File* f);
  </code></pre>
  
  <p>Two questions:</p>
  
  <ol>
  <li>As seen in the comment, will f go out of scope when the function returns?</li>
  <li>Do you suggest writing function using reference or pointer? (I'm talking about <strong>private</strong> functions)</li>
  </ol>