random number generation

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()

DO you know size of your range in advance, or you need to select one from a continuous stream of unknown size?
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.