Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

random number cpp

// Add thus to with the headers
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// Generate a function that will give values between l and r inclusive
auto dist = uniform_int_distribution<int>(l, r);
// get the random number using dist(rng);
Source by www.bitdegree.org #
 
PREVIOUS NEXT
Tagged: #random #number #cpp
ADD COMMENT
Topic
Name
3+3 =