What is the srand() function from the standard library used for?
The rand function will constantly return the same sequence of random numbers. This is convenient only at the debugging stage. In order for the sequence to be different all the time, when starting the application, you need to specify seed - this is achieved by calling srand. See srand().

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Зареєструйся Зараз
або Підпишись на майбутні тести