Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::srand sets the seed of the random number sequence that can be created by std::rand sequence.
The code below demonstrates that after setting a seed of zero, the first 'randomly drawn' number is always the same.
#include <iostream> |
RandomizeTimer can be used to set a seed based on the system time.
#include <cstdlib> |
The code below demonstrates that after setting a seed of zero, the first 'randomly drawn' number is always the same.
#include <cassert> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.