Page 1 of 1

how to use function "random" in vc6.0

Posted: Fri Aug 02, 2002 6:49 pm
by hello world
help,help;

Posted: Tue Sep 17, 2002 12:32 pm
by tenshi
#include<stdlib.h>
#include<time.h>

int main()
{
srand(time(NULL));
....
....
// rand()%n can get a integer from 0..(n-1)
....
}