title: Does C# pass a List<T> to a method by reference or as a copy?
body: <p>Taking my first steps in C# world from C/C++, so a bit hazy in details. Classes, as far as I understood, are passed by reference by default, but what about eg. List&lt;string&gt; like in:</p>
  
  <pre><code>void DoStuff(List&lt;string&gt; strs)
  {
      //do stuff with the list of strings
  }
  </code></pre>
  
  <p>and elsewhere</p>
  
  <pre><code>List&lt;string&gt; sl = new List&lt;string&gt;();
  //next fill list in a loop etc. and then do stuff with it:
  DoStuff(sl);
  </code></pre>
  
  <p>Is <b>sl</b> in this case passed by reference or is a copy made so that I'd need to redefine the worker function like <pre>void DoStuff(ref List&lt;string&gt; strs)</pre> to actually act on <b>sl</b> itself and not a copy?</p>