What is the srand() work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the srand() work?

Please help me anyone.

1st Apr 2020, 8:13 AM
Naveed
Naveed - avatar
14 Answers
+ 5
The srand() function sets the starting point for producing a series of pseudo-random integers. If srand() is not called, the rand() seed is set as if srand(1) were called at program start. Any other value for seed sets the generator to a different starting point
2nd Apr 2020, 6:25 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
1st Apr 2020, 9:35 AM
Ipang
3rd Apr 2020, 7:51 AM
narayanaprasad
narayanaprasad - avatar
3rd Apr 2020, 7:53 AM
narayanaprasad
narayanaprasad - avatar
+ 1
Please search the forum as this subject had been discussed quite frequently. BTW, you don't need to write a name in thread tags. If you wish to mention a friend, then do so in the thread Description. Edit your thread, in the Description type @ and then select a name from the popup list of names. You can tag C srand instead ...
1st Apr 2020, 9:04 AM
Ipang
+ 1
Thank you for suggestion bro. Ipang
1st Apr 2020, 9:08 AM
Naveed
Naveed - avatar
+ 1
I didnt understand the srand() bro please help me.Ipang 😰
1st Apr 2020, 9:12 AM
Naveed
Naveed - avatar
+ 1
Sorry bro, I didn't mean "tag" by @csrand. I mean, you can type 'C srand' (without the quotes) in the Relevant Tags' input. As for @, it is used to mention a friend, like you mentioned me here. You can mention Junaid in the thread Description, but not in the 'Relevant Tags'. He will get notified if you mention him, then he can come in. * Tags are words written in 'Relevant Tags' section that are related to thread topic, and can describe or improve the scope and/or context clarity. e.g. 'C srand' C -> Relevant language srand -> Relevant subject Hope it's clear bro Naveed Ahmad
1st Apr 2020, 9:21 AM
Ipang
+ 1
Bro what is 'seed' means?😍
1st Apr 2020, 10:14 AM
Naveed
Naveed - avatar
1st Apr 2020, 11:05 AM
Ipang
+ 1
Thank you soo much bro👏🏻.
1st Apr 2020, 11:10 AM
Naveed
Naveed - avatar
0
Okay no problem 👌
1st Apr 2020, 9:09 AM
Ipang
0
How can bro i tag the csrand?
1st Apr 2020, 9:11 AM
Naveed
Naveed - avatar
0
You're welcome bro! 👌
1st Apr 2020, 11:11 AM
Ipang