由于某种原因,这不会编辑输入到其中的数组的大小,并且不会将数据添加到输入的数组中。
public static void RandomizeArray(int[] array)
{
int intRead;
int intReadSeed;
Random randomNum = new Random();
Console.WriteLine("How many ints do you want to randomly generated?");
intRead = Convert.ToInt32(Console.ReadLine());
array = new int[intRead];
Console.WriteLine("What's the maximum value of the randomly generated ints?");
intReadSeed = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < intRead; i++)
{
array[i] = (randomNum.Next(intReadSeed));
}
Console.WriteLine("Randomization Complete.\n");
}