Is there a function that generates k random numbers within a specified range.
For example I want 5 random numbers between 0 to 100, with or without replacement.
Is there a function that generates k random numbers within a specified range. For
Share
You could use std::generate_n with either
rand()or a generator from the new C++11 random number generators.