We will implement a procedure that prints a nice illustrating histogram of the numbers a random generator produces. Then, we will run all STL random number generator engines through this procedure and learn from the results. This program contains many repetitive lines, so it might be advantageous to just copy the source code from the code repository accompanying this book on the Internet instead of typing all the repetitive code manually.
- At first, we include all the necessary headers and then declare that we use the std namespace by default:
#include <iostream> #include <string> #include <vector> #include <random> #include <iomanip> #include <limits> #include <cstdlib> #include <algorithm> using namespace std;
- Then ...