random number generation

Mar 12, 2014 at 8:00am
hey guys lets say i have got a range of numbers (1,1,2,4,8) and want to select at random one of the numbers in my stream above using rand() or srand()

Mar 12, 2014 at 9:05am
DO you know size of your range in advance, or you need to select one from a continuous stream of unknown size?
Mar 12, 2014 at 9:13am
using rand() or srand()

You will need srand() to seed the random generator (rand()) and rand() to generate the random numbers if you are using that as your generator.
Topic archived. No new replies allowed.