What is the difference between a C# Reference and a Pointer?

后端 未结 10 1877
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 21:45

I do not quite understand the difference between a C# reference and a pointer. They both point to a place in memory don\'t they? The only difference I can figure out is that

10条回答
  •  鱼传尺愫
    2020-11-28 22:25

    A pointer can point to any byte in the address space of the application. A reference is tightly constrained and controlled and managed by the .NET environment.

提交回复
热议问题