2.C#引用参数ref与输出参数out

ref与out在如下代码中均可编译成功 可是有本质上的区别web static void Test(ref int i) { i = 2; } static void Main(string[] args) { int a = 1; Test(ref a); } ref可将在Main方法中定义的参数a读取到svg static void Test(ref int i) {
相关文章
相关标签/搜索