I wrote a program in Qt Creator 1.0.0 (Qt version 4.5.0), where at the beginning of the main () function I put
srand(time(0));
Then I call rand () from another thread (subclass of QThread). In this function, rand () produces the same sequence of numbers every time I run the program. I do not run the program several times per second.
Why is this happening?
source share