random number generation

Hi
I have developed a new program array of 10 number and I want to choose any one out of them randomly. How can I do that?
could you show us your program?
First, you need a PRNG.
http://www.cplusplus.com/faq/beginners/random-numbers/

Next, you have two options.
1 - choose a random index into the array (using random_int_in_range() or something similar).
2 - randomize the array and choose the first item.

Hope this helps.
Topic archived. No new replies allowed.