Borland C++ reference

randomize

raw OCR

InitiaHzes random number generator.

Defined in header <stdlib.h>

Syntax

#include <stdHb.h>
#include <time.h>
void randomize(void);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

randomize initializes the random number generator with a random value. Because randomize is implemented as a macro that calls the time function prototyped in time.h, we recommend that you also include time.h when you use this routine.

Return value

None.

See also

Example

*include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main(void)
{
   int i;
   randomize 0;
   printfC'Ten random numbers  from 0 to 99\n\n");
   for(i=0; i<10; i++)
       printf ("%d\n", randO  % 100);
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.

Extraction notes

  • header `stdHb.h` read as `stdlib.h`