i have a problem regarding my code. I have tried searching on it, but it only confused me more.
I want to split an array(called Array
for simplicity) of size 6 in half. one of the halves will move to another array, called Split1
But it gives me an error when trying to move the numbers using a for loop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
int[,,,,,] Array = new int[7, 5, 9, 4, 2, 1];
int[] Split1 = new int[3];
for (int i = 0; i <= Array.Length / 2; i++)
{
Split1[i] = Array[i]; //This is where i get my error
}
}
}
}
If you could point me to the right direction, I would be grateful