I'm trying to find a set of random numbers between 1 and 365, so I tried to use:
DayOfBirth = rand() % 365 + 1;
But, I've been told that srand() will produce a better random number, is this true? How do I use it for this instance?
[quote]a good one is the mesner twister [/quote] It's called the Mersenne Twister. Just a quick note on the cast in my srand call -- srand ideally takes an unsigned int but time comes back with a one that is of type time_t, which is normally a typedef of integer. … Read More
>>[B]But, I've been told that srand() will produce a better random number[/B] Whomever told that to you should not talk about programming anymore. All srand does is seed the random number generator. [B]>>a good one is the mesner twister >>It's called the Mersenne Twister.[/B] Yes that is better than rand, … Read More
Edited by jonsca: n/a
Edited by NathanOliver: n/a
Edited by jonsca: time_t