I plan to create a challenge which will involve predictable randomness. I understand that for a given system, if srand()
is seeded using the same value, rand()
will return a predictable sequence of results. However I’m not sure to what extent this sequence is consistent between different systems. Will the result be the same as long as the compiler uses the same implementation? Or will the same program on two different systems yield different results?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…