Fill a vector with random numbers c++
You can use std::generate algorithm to fill a vector of n elements with random numbers. In modern C++ itβs recommended not to use any time-based seeds and std::rand, but instead to use random_device to generate a seed. For software-based engine, you always need to specify the engine and distribution. Read More.. #include <random> #include <algorithm> … Read more