Question: I know that struct is a value type , that means it defined on stack .

But I can do A a = new A(); (A my struct of course). and it defined on heap , and only the reference variable is on stack.

Can you explain me this one please .

Answer: 
Value types are stored on the stack *sometimes*. It's a complex topic and usually the exact storage of a variable (stack or heap) is irrelevant for programming issues. The real difference between value and reference types lies in their *behaviour* (for example, value types are always copied *by value*).

Eric Lippert covers this issue in detail:

* <http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx>
* <http://blogs.msdn.com/b/ericlippert/archive/2009/05/04/the-stack-is-an-implementation-detail-part-two.aspx>
* <http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx>
The original assumption that value types live "on the stack" is not correct. However, **[The Truth About Value Types](http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx)** has been revealed by Eric Lippert:

> 
> 1. It is usually stated *incorrectly*: the statement should be "value types *can* be stored on the stack", instead of the more common "value types are always stored on the stack".
> 2. It is almost always *irrelevant*. We've worked hard to make a managed environment where the distinctions between different kinds of storage are hidden from the user. Unlike some languages, in which you must know whether a particular storage is on the stack or the heap for correctness reasons.
> 3. It is incomplete. What about *references*? References are neither *value types* nor *instances of reference types*, but they are values. They've got to be stored somewhere. Do they go on the stack or the heap? Why does no one ever talk about them? Just because they don't have a type in the C# type system is no reason to ignore them.
> 
> 
>