When I was making this code, every time the program produces a random number, it is the same thing. I have already seeded the random number so that it makes a random number according to the current date and time. The problem is, I wan t the program to produce a new different number each time. So is using this: srand(static_cast<unsigned int>(time(0))); The only way? And if there is another way please tell me. Also, if this can be changed to make a new number each time the program produces a number?