Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

rand() and srand() in C/C++

rand() function is used in C/C++ to generate random numbers in the range
[0, RAND_MAX). 

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. 
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+9 =