answersLogoWhite

0

What is srand in c plus plus?

User Avatar

Anonymous

15y ago
Updated: 8/19/2019

Srand (seed random ) is used to seed random numbers and is used before calling the rand() or the random number generator.

Seeding random numbers ensures that each time the code is executed the number generated is completely random.

srand requires one parameter. For most cases it is sufficient to make this parameter time(NULL) [remember to include time.h] as this will seed a new bunch of random number every second

User Avatar

Wiki User

15y ago

What else can I help you with?