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

C# - Passing Reference-Type Parameters

时间:2017-04-24 15:33:52      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:div   however   ide   style   int   block   contains   pass   ack   

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

标签:div   however   ide   style   int   block   contains   pass   ack   

原文地址:http://www.cnblogs.com/liguangsunls/p/6756862.html

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