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

Usage

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

   ANSI

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>

   int main()
   {
       int i;
       for(i = 0;i < 20;i++)
           printf("i: %d rand(): %d\n",i,rand());
       return EXIT_SUCCESS;

   }

Return Value

   An integer containing the random number.

See Also

   srand



See Also: srand

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