smailxiaobai
 class Program
{
static void Main()
{
int[] it = new int[10];
for (int i = 0; i < it.Length; i++)
{
Console.WriteLine(it[i]);
}

int[] oldim = new int[it.Length];
Array.Copy(it, oldim, it.Length);//对原始数组的浅拷贝,返回对新数组的引用。
test(oldim);//000000。。
test(it);//123456.。。
for (int i = 0; i < it.Length; i++)
{
Console.WriteLine(it[i]);
}
//int[] ildim = new int[5];

Console.ReadKey();
}
static void test(int[] i)
{
for (int n = 0; n < i.Length; n++)
{
i[n] = n;
}
}
}

分类:

技术点:

相关文章:

  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-09-24
  • 2021-10-12
相关资源
相似解决方案