求助 List<t> 的字符数组问题
using System;using System.Collections.Generic;
public class Example
{
public static void Main()
{
List<string[]> a = new List<string[]>();
string [] b=new string [2];
b[0] = "adf";
b[1] = "rtgh";
a.Add(b);
b[0] = "456ret";
b[1] = "nt567";
a.Add(b);
b[0] = "dfh55t";
b[1] = "nderthert";
a.Add(b);
Console.WriteLine(a.Count .ToString ());
foreach (string[] s in a)
{
Console.WriteLine(a[0][0]);
Console.WriteLine(a[0][1]);
}
}
}
得到的结果是三组相同的字符数组
怎样才能前两项不被覆盖啊