C# - Passing Reference-Type Parameters

2020-12-13 13:54

阅读:653

标签:passing   reference-type   parameters   c#   


A variable of a reference type does not contain its data directly; it contains a reference to its data. When you pass a reference-type parameter by value, it is possible to change the data pointed to by the reference, such as the value of a class member. However, you cannot change the value of the reference itself; that is, you cannot use the same reference to allocate memory for a new class and have it persist outside the block. To do that, pass the parameter using the ref or out keyword.

C# - Passing Reference-Type Parameters

标签:passing   reference-type   parameters   c#   

原文地址:http://blog.csdn.net/troubleshooter/article/details/40541713


评论


亲,登录后才可以留言!