using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace vc_test
{
class Program
{
static void Main(string[] args)
{
Parames();
Console.ReadKey();
}
static void Parames()
{
int [] test={1,3,4};
int[] test2;
ArrayList arr = new ArrayList();
arr.Add("3");
arr.Add("6");
arr.Add("9");
test2 = new int[3];
//显示化初始数组
foreach (object a in test2)
Console.Write("{0},", a);
//第一种复制数组元素方法
object[] dd;
dd = arr.ToArray();
foreach (object a in dd)
Console.Write("{0},", a);
//第二 种复制数组元素方法
//test.CopyTo(test2, 0);
//foreach (object a in test2)
// Console.Write("{0},", a);
}
}
}
数组复制
最新推荐文章于 2023-10-03 20:44:02 发布