User =?iso-8859-1?q?Darryl=20Chapman?= (firstname.lastname@example.org) posted:
Does anyone know how to use the getrand function?
I seem to be having huge problems using it!!
I need to create a random value between say 1 and
1000, this seems to be harder than I first thought,
help on this would be greatly appreciated.
User Neil Cameron (email@example.com) posted:
I wrote my own function to do this try it out.
int GetRandom(int min, int max)
// Generate a random number between min and max
srand( clock() );
rndnum = rand();
while (rndnum > max | | rndnum < min);
User frederic ballut (firstname.lastname@example.org) posted:
Simply use the function as follow
rv_nb = get_random_number(0,1000);
the variable rv_nb will contain your random number in this case between 0
I hope this helps