.NET stack and heap, what goes where when I declare a string?

后端 未结 3 1563
北荒
北荒 2020-12-10 16:58

If I execute this line I create a string which is a reference.

string mystring = \"Hello World\"

Is variable mystring in the

3条回答
  •  情话喂你
    2020-12-10 17:05

    Read these... From Eric Lippert... he wrote the C# compiler! Should answer all your questions.

    http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx

    http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx

提交回复
热议问题