Reference types live on the heap, value types live on the stack
<p>while reading "C# in Depth" I was going through the section "Reference types live on the heap, value types live on the stack."</p>

<p>Now what I could understand is  (mainly for ref type) :</p>

<pre><code>class Program
{
    int a = 5;  // stored in heap

    public void Add(int x, int y) // x,y stored in stack
    {
        int c = x + y;  // c  stored in stack
    }
}
</code></pre>

<p>Just want to clarify if my assumptions are right. Thanks.
EDIT:
I should have used diff variables, i think  it created a confusion.so I have modified the code.</p>

<p>EDIT:
Yes, as Jon mentioned - it's a myth, I should have mentioned that.My apologies.</p>
