I know how to get a random number using the time as a seed, but how can i have it be between two speficied numbers? (say, 65 to 90)
Printable View
I know how to get a random number using the time as a seed, but how can i have it be between two speficied numbers? (say, 65 to 90)
You want random capital letters... chars from 65 to to 90....
Try:
PHP Code:unsigned char r=0;
while (r<65){
r = rand() % 91;
}
printf("%c \n" , r);
Lol, so you saw that :p Thanks for the help.
Is it possible to have multiple ranges? ( I am trying to get any alphanumeric character)
Z.Code:r = rand() % (max - min) + min
Thanks, that helps a lot.