0
我試圖拿起C#並且一直在做一些練習程序。在這其中,我嘗試在practiceArray到practiceArray2轉移整數,但我沒有成功,反而獲得此作爲輸出:C#for循環和數組(練習練習)
System.Int32[]
System.Int32[]
我的程序的代碼如下:
static void Main(string[] args)
{
int[] practiceArray = new int[10] {2,4,6,8,10,12,14,16,18,20 };
int[] practiceArray2 = new int[practiceArray.Length];
for (int index = 0; index < practiceArray.Length; index++)
{
practiceArray2[index] = practiceArray[index];
}
Console.WriteLine(practiceArray);
Console.WriteLine(practiceArray2);
}