Studying PRNG. To generate a constantly changing sid when running rand() use the srand(time(null)) function srand(time(null)) With time(null) it’s clear that it will return the number of seconds after January 1, 1970. For example, if the actual date is 01/01/1970 and 00:20 - it will show 1200 if I'm not mistaken. But what will srand(time(null)) show? if time(null)=1200 , what will the seed be? In terms of what number it will turn out. I read that nothing is returned, but I did not understand it. And how to understand the launch of PRNG. Does this mean the inclusion of the program, or is the 1-generation generation of the HRP?

  • In PRNG, the next value is usually calculated based on the previous one. Starting is the generation of the very first value on the basis of which the following will be calculated. And see for yourself what kind of seed it will turn out it depends on the algorithm of a particular PRNG which in turn depends on the OS and the libraries used - Mike
  • In the end, you may not initialize the generator at all, though with each time you start the program you will receive the same sequence - Mike
  • And do you mean that srand generates a number based on one or another method of generating PSP, as for example - based on a linear congruential method, fibonacci method, etc.? - deinstalation
  • And how else can he generate if there is no hardware generator in the system - Mike

0