C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Random Number Functions
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The srand function sets the starting point for generating a series
     of pseudorandom integers. To reinitialize the generator, use 1 as
     the <seed> argument. Any other value for <seed> sets the generator
     to a random starting point.
 
     The rand function returns a pseudorandom integer in the range
     0 to RAND_MAX. Calling rand before any call to srand generates the
     same sequence as calling srand with <seed> passed as 1.
 
     Return Value
 
     The rand function returns a pseudorandom number, as described
     above. There is no error return for either function.
                                    -♦-