Mail Archives: djgpp/1998/11/04/04:13:19
On 2 Nov 1998, Pierre MAZIERE wrote:
> srandom(int seed) /* what is the meaning of this 'seed' ?*/
> for( ... )
> {
> i=random();
> printf("%u \n",i);
> ...
>
> };
>
> Then things:
> - Every time I launch the executable, the sequence of so called random
> numbers printed on screen is always the same ( so where is the randomized
> stuff ?)
I tried to explain all this in section 22.22 of the DJGPP FAQ list.
Please see if the information there is what you need.
> - How can I manage to have 'i' between 0 and MaxRandomNumber ?
This happens by default, if by MaxRandomNumber you mean the constant
RAND_MAX defined on the stdlib.h header file.
- Raw text -