C++C++11C++14C++17C++20Introduction to C++IteratorsLearn C++Syntax

What Are The Differences Between std::rand() And std::mt19937 In Modern C++?

Random numbers are widely used in today’s modern applications. In C we use rand(), srand() and in C++ it is std::rand(), std::srand(). Since C++11, we can use the Mersenne Twister random generators;  mt19937 (std::mt19937) for 32-bit applications and mt19937_64 (std::mt19937_64) for 64-bit applications. Modern C++ allows us to use both old and new random generators. In this post, we explain…
Read more