Possible Duplicate:
What is the most random function in C++?
In C++, is this safe:
int main() {
srand(time(0));
unsigned char arr[10];
for(int i=0; i <sizeof(arr); ++i)
arr[i] = (unsigned char)rand();
}
Is there a better way to randomly fill a byte array in a platform independent way? failing that, is there a better way to do this on windows? (I know rand() isn't a very good PRNG, I'm just using it as an example).
Thank you!