Advertisement

I need a good random numbers generator

Started by November 29, 1999 03:32 PM
0 comments, last by HIND-D 25 years ago
Does anyone have any idea about how to make a random number generator in C wich doesent return the same numbers all the time...?
Jonatan Hedborg

If you seed the Random Number differently you will get a different set of "random" numbers. Using the time to seed the generator is a good way of doing this

#include
#include
#include
.
.
.

srand( (unsigned)time( NULL ) );

Taken from MSDN.

Keeb

This topic is closed to new replies.

Advertisement