注意如下区别!
private string ChangeString(string src) { src = "123"; return src; } private string ChangeRefString(ref string src) { src = "ref123"; return src; } string xx = "456"; MessageBox.Show(ChangeString(xx));//123 MessageBox.Show(xx);//456 ChangeRefString(ref xx); MessageBox.Show(xx);//ref123
标签:src,MessageBox,string,Show,C#,456,xx,引用 From: https://www.cnblogs.com/sinceret/p/17048912.html