标签:class blog code 使用 2014 string
(1) 两者都是按地址传递的,使用后都将改变原来的数值
(2) ref传进去的参数必须在调用前初始化,out不必(5) ref是有进有出,out是只出不进
string outString = "This is the original outString"; Console.WriteLine(outString); outMethod(out outString); Console.WriteLine(outString); string refString = "This is the original ref string"; Console.WriteLine(refString); refMethod(ref refString); Console.WriteLine(refString);
10 ref 和 out 之间的区别,布布扣,bubuko.com
标签:class blog code 使用 2014 string
原文地址:http://blog.csdn.net/u011685627/article/details/33370391