srand

Starts a new sequence of pseudo-random integers to be returned by subsequent calls to the rand function.

Library:LibC
Classification:ANSI
Service:General C Services

Syntax

  #include <stdlib.h> 
   
  void srand (
     unsigned int   seed);
  

Parameters

seed

(IN) Specifies the initial seed value passed in by the user.

Remarks

A particular sequence of pseudo-random integers can be repeated by calling srand with the same seed parameter value.

See Also

rand, rand_r