+ 3
What is the difference between rand() and srand()??? please clarify...
3 ответов
+ 5
srand creates a seed that will be used by rand, you call srand only once in your program and you can use the current time to create a sead that rand will use e.g
#include <ctime>
int main {
srand (time (0));
rand ()
return 0;
}
0
what do you mean by seeded random number??
- 2
srand is a seeded random number