Use of qsrand, random method that is not random

后端 未结 7 2654
误落风尘
误落风尘 2021-02-19 00:12

I\'m having a strange problem here, and I can\'t manage to find a good explanation to it, so I thought of asking you guys :

Consider the following method :



        
7条回答
  •  [愿得一人]
    2021-02-19 00:30

    If you call the qsrand Qt function to initialize the seed, you must call the qrand Qt function to generate a random number, not the rand function from the standard library. the seed initialization for the rand function is srand. Sorry for the dig up.

提交回复
热议问题