+ 4
What is rand in C++
rand
7 Answers
+ 50
rand() can be used to generate random numbers. For more information, refer http://www.cplusplus.com/reference/cstdlib/rand/
+ 20
https://www.sololearn.com/learn/CPlusPlus/1638/
+ 5
The C++11 standard introduced the <random> header to replace rand. Using rand is no more best practice.
+ 2
rand() is used with stand to get randomized numbers.
It means it gives different numbers on different times.
It retuens any of 0 to n-1 number.
It is more useful than randomize() and random()
+ 1
@Raghav Is that Python? Because it's definitely not part of STL.
0
random function when used like
random(n);
it will produce any number from 0 to n-1 randomly
0
2