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 - rand http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   rand

   Usage
   #include <stdlib.h>
   int rand(void);

   Description
   rand returns a random number in the range 0 to 32767. srand seeds  the
   random number generator. See srand for description.

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

   Return Value
   An integer containing the random number.


See Also: srand

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