How to do it...

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.

  1. 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;
  1. Then we ...

Get Expert C++ Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.