Straight forward, this is my simple example:
#include <iostream>
#include <random>
int main()
{
std::random_device rd;
std::mt19937 mt(rd());
std::uniform_int_distribution<int> dist(0,100);
std::cout << dist(mt) << std::endl;
return 0;
}
Every time I run the program, it gives the same answer: 56
This code should output a random number each time, but it doesn't... why?
Aucun commentaire:
Enregistrer un commentaire