Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - srand http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   srand

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

   Description
   srand  initializes  the  random number generator rand()  with  a  seed
   number. If srand() is never called, then the default is as if srand(1)
   was called.

   Example
   #include <stdio.h>
   #include <stdlib.h>
   main()
   {
   int i;
   srand(9);
        for(i = 0;i < 20;i++)
             printf("i: %d rand(): %d\n",i,rand());
   }


See Also: rand

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson