randomizer

Started by
3 comments, last by HolyFish 22 years, 1 month ago
What is the function in C/C++ to generate a random number ??? Or should I make a randomizer myself ?? Thanks !
Advertisement
rand()
---visit #directxdev on afternet <- not just for directx, despite the name
Sorry, forgot to say : a random number between two given numbers....
rand() There''s also a few discussions going on right now about how to get good distrobutions of random numbers. I''m too lazy to find them all (I think there''s 2 or 3) but here''s just one that contains a good example of using rand(). ''Generating a range of random integers''

Cheers!

-pirate_dau
this should be something you solved with pencil in paper but...

r = rand()%( upper + 1 - lower ) +lower;

This topic is closed to new replies.

Advertisement