I'm using a method to create two new int
arrays with random numbers,
but the two array contains exactly the same numbers. Why is this happening?
static void Main(string[] args)
{
int[] Foo1= Foo(1000);
int[] Foo2= Foo(1000);
}
static int[] Foo(int length)
{
int[] Array = new int[length];
Random r = new Random();
for (int i = 0; i < length; i++)
{
Array[i]=r.Next(1, 101);
}
//Thread.Sleep(6);
return Array;
}