C# reference assignment operator?

后端 未结 6 572
滥情空心
滥情空心 2020-12-11 08:28

for example:

        int x = 1;
        int y = x;
        y = 3;
        Debug.WriteLine(x.ToString());

Is it any reference operator inste

6条回答
  •  伪装坚强ぢ
    2020-12-11 08:40

    The only way to do this is to use "unsafe" code, and actually use pointers. Pointers cannot exist outside of unsafe code blocks in C#. You should then be able to use pointers the same way you do in C/C++

    Check out this page for how to use "unsafe" code blocks.

提交回复
热议问题