jeudi 1 janvier 2015

Can't generate random number

I'm trying to generate random numbers in a loop. I make an instance of the Random class before the loop starts, but it is inaccessible. The error i get is:



'System.Random.Sample()' is inaccessible due to its protection level



My code is:



Random random = new Random();
while (ready == false)
{
double h = random.Sample();
//Lots of things done here
}


What's wrong?





Aucun commentaire:

Enregistrer un commentaire