• Advertisement

Archived

This topic is now archived and is closed to further replies.

I need a good random numbers generator

This topic is 6718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone have any idea about how to make a random number generator in C wich doesent return the same numbers all the time...?

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

  • Advertisement