更新时间:2023-02-03 12:20:38
看到这个, srand - C ++参考a> [ ^ ]。它设置种子,然后调用rand()来获取值。
值时间(null)
value是rand()
调用的返回值。
有关示例,请参阅 RyanDev 提出的链接
i am new to C . I am using srand(time(null)) to 'seed' a time value. My question is how to retrieve the value seeded by this function? i want to display the value on the screen
See this, srand - C++ Reference[^]. It sets up the seed then you call rand() to get the value.
The value 'seeded' by thetime(null)
value is the return value of therand()
call.
See the link proposed by RyanDev for an example.