Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Programming/Code/Standard C Library/Functions/srand

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

srand #include <cstdlib> void srand( unsigned seed ); The function srand() is used to seed the random sequence generated by rand(). For any given seed, rand() will generate a specific "random" sequence over and over again. srand( time(NULL) ); for( i = 0; i < 10; i++ ) printf( "Random number #%d: %d\n", i, rand() ); Related topics rand(Standard C Time & Date functions) time