With C ++ 11 you can use std::random_device . I suggest you look at the link for a detailed guide.
Extracting a substantial message from a video call: you should never use srand and rand , but instead use std::random_device and std::mt19937 - for most cases you will need the following:
#include <iostream> #include <random> int main() { std::random_device rd; std::mt19937 mt(rd()); std::uniform_int_distribution<int> dist(0,99); for (int i = 0; i < 16; i++) { std::cout << dist(mt) << " "; } std::cout << std::endl; }
source share