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) {
相關文章
相關標籤/搜索