+ 1
what is srand?
3 Answers
+ 3
seed-rand, you will use this to set the random seed in the program for example
srand(155);
std::cout<<(rand()%100+1);
the above will output 1-100 however since the seed is 155 every time it will output the same number, instead you can input time as the random seed using the ctime library.
srand(time(0));
the above seed will give a different possible output everytime.
0
yea relatively like that
0
a truly random function