* gerol:
Quote:
I'm comparing some database system, amongst others Berkeley DB. So I
wrote an application that fills random data into the different database
systems. To be able to compare the database systems it is important that
the random data is equal at every pass --- therefore I initialize
srand() with a fixed seed. |
Write your own random number generator, for instance (completely
untested, but the magic number 134775813 shouldn't be too bad):
uint32_t my_seed = 1;
uint32_t my_random(void)
{
my_seed = 134775813 * my_seed + 1;
return my_seed;
}
Then you need not care if anybody else calls rand().