random - rand() and a Mersenne Twister C++ implementation -


i need implement rng , guess mersenne twister me. didn't find anywhere working c++ implementation, bad google searcher or not simple find?! i've tried before rand():

srand((unsigned)time(0)); (int = 0; < 9; i++) {      random =  rand();      cout<<random; } 

i don't know why, random variable same number.....but if add sleep(1000), works! this:

srand((unsigned)time(0)); (int = 0; < 9; i++) {     random =  rand();     cout<<random;     sleep(1000); } 

so decided try mersenne twister...could find solution of (because need find very big number of random numbers can't use sleep(1000), takes eras!) or me implement mersenne twister or maybe rng. , sorry bad english...

c++11 includes mersenne twister random standard library header.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -