How to select random things of an array. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to select random things of an array.

I think it might be rand() but when I use it it won't work.

7th Feb 2017, 7:09 PM
Mr. Robot
Mr. Robot - avatar
1 Answer
+ 1
You can "#include <cstdlib> using namespace std;", then use "rand() % length_of_your_array".
7th Feb 2017, 7:17 PM
Álvaro