0
How can you generate random numbers for an array on C++
I wanted to randomize a array of numbers on C++ but I can’t seem to find a way to do it. Anybody got a suggestion?
2 ответов
+ 1
headers <cstdlib> , <ctime> , and functions srand() , and rand(). and you can use loop to fill array
http://www.cplusplus.com/reference/cstdlib/rand/
0
Are trying to generate random numbers and then assign them to an array or are you trying to randomly re-arrange the order the elements within an array?
Anyway,...look up 'random_shuffle' from the <algorithm> header file.