Back to photostream

Random Number | Learn CPlusPlus

In C++, the "rand()" function generates pseudo-random numbers between 0 and RAND_MAX. To ensure different sequences, "srand()" initializes the random number generator with a seed. However, C++11 introduces library, providing better randomness and more control. It offers various distributions like uniform, normal, and discrete. Developers should prefer over rand() for modern C++ programming. If you want to explore more about Random Number, take a look at this blog.

6 views
0 faves
0 comments
Uploaded on March 7, 2024