Quote:
Originally posted by GoZelda
int random = (rand()%10);
Which is not newbie-friendly
|
Which is not even how you are supposed to do it, try:
random = (int)(10.0 * rand() / (RAND_MAX + 1.0));
Probably not much difference these days, but rand()%10 used to return less random numbers.