lundi 19 octobre 2015

C++: How to generate a random number from an array

I´ve an array which stores 5 inputs (int), in a guessing-game.

What I would like to do is to generate a random number (pick one of five numbers which is stored) from that array, can anyone help me with this?

I'm familliar with the rand-fuction but only to pick a random number within a range och numbers, not between 5 inputs...




Aucun commentaire:

Enregistrer un commentaire