0
C++ RANDOM
Hi guys. I didnt understand random function , how does it work , the srand and the time function in rand and also the seed. I tried to understand on other webistes but NOTHING. Can someone explain me how do they work in simple words thanks.
2 Respuestas
+ 2
The rand function is the seed or base for random to work. And the rand function has a predetermined number that every time the program is run it starts with the same number, causing the same results every time it is run again. That is why you have to change the value every time you start your application. from here comes the time. The time always changes it is not static and if you can put it as a seed you can make a random function that every time you start your program it can change the seed automatically
0
thanks