I have to copy the following int array in to Array :
int[] intArray=new int[] {10,34,67,11};
i tried as
Array copyArray=Array.CreateInstance(typeof(int),intArray.Length,intArray);
intArray.CopyTo(copyArray,0);
But ,it seems i have made a mistake,so i did not get the result.
This works:
You had one extra “intArray” in your Array.CreateInstance line.
That being said, this can be simplified if you don’t need the Array.CreateInstance method (not sure if that’s what you’re trying to work out, though):
Even simpler: