Hi community,
i have a small problem with the random function in the thread!
i opened two threads with _beginthread() but n of first thread is equal to n of second thread :confused:..
help me please, i need a random number from 0 to 3..
the second n should not be equal to the first n!
if possible I would like to know the reason ;)
sorry for my english *-*
i have a small problem with the random function in the thread!
Code:
int rand_func()
{
srand((unsigned int)time(NULL));
int output = rand()%3;
return output;
}
void test(void *id)
{
int n = rand_func();
}
help me please, i need a random number from 0 to 3..
the second n should not be equal to the first n!
if possible I would like to know the reason ;)
sorry for my english *-*