码迷,mamicode.com
首页 > Windows程序 > 详细

C# - Passing Reference-Type Parameters

时间:2014-10-28 17:55:49      阅读:227      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!