Is it possible to generate different random number, every time loop runs. For example, i have:
for (int t=0;t<10;t++)
{
int random_x;
srand ( time(NULL) );
random_x = rand() % 100;
cout<<"
Random X = "<<random_x;
}
But the problem is, it generates same random number everytime. Is it possible to generate different random numbers everytime loop runs?
IS there any possibility to reset random number initiallization as well?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…