rand() |
|
|
srand(unsigned int)
, otherwise it'll be rather predictable in its output. A lot of us do this using srand(time(0));
, which requires you to #include <time>
but has the benefit of generating much less predictable results that change each time.