|
From: <or...@vp...> - 2004-01-18 08:05:29
|
Noorez Kassam wrote: > What is the function to generate a random number? rand() Include stdlib.h to use it. You might also want to seed it before use: srand(seed) with a number (GetTickCount() or something similar). rand() gives you a number between 0 and RAND_MAX. To get a number between 0 an 10, you can use formulas like this: rand()/(RAND_MAX/10); -- Greetings, Balázs |