Rand
I'm making blackJack game and i have a problem with geting random number. Function
1 2 3 4
|
void getcard(){
srand(time(NULL));
card=rand()%10+1;
}
|
'card' was declared as int and it is used in other void function.
Problem is that i always get 0. What's wrong here?
Try to call srand() only once (at the beginning of your program)
Thanks!
Topic archived. No new replies allowed.