C# box or copy when passing structs by reference?
<p>Does c# box a struct here?</p>

<pre><code>struct S { int x; }

void foo(ref S s) { s.x = 1; }

main { 
  var s = new S();
  foo(ref s); &lt;-- boxing??
}
</code></pre>

<p>I have heard weird stuff about structs in classes.  Is there boxing here?  is this passing a copy of the member?</p>

<pre><code>class C { S s; }

main { 
  var c = new C();
  foo(ref c.s); &lt;-- boxing here?? copy here???
}
void foo(ref S s) { s.x = 1; }
</code></pre>