Skip to content

Instantly share code, notes, and snippets.

@jsxinvivo
Created December 3, 2015 14:32
Show Gist options
  • Save jsxinvivo/f628f2726410d7143f84 to your computer and use it in GitHub Desktop.
Save jsxinvivo/f628f2726410d7143f84 to your computer and use it in GitHub Desktop.
Generating random number using C++ 11 <random> library
#include <random>
std::random_device rseed;
std::mt19937 rgen(rseed()); // mersenne_twister
std::uniform_int_distribution<int> idist(0,100); // [0,100]
std::cout << idist(rgen) << std::endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment