static void Main(string[] args) {
List<string> list = new List<string>();
list.Add("abc");
ChangeOrNot(list);
var query = from p in list select p;
foreach (string l in query) { Console.WriteLine(l); }
}
private static void ChangeOrNot(List<string> list)
{
list.Add("def");
}
输出abc def,并没有加ref关键字.
求解原理.
慕神8447489