Random Number Generator is always generating the same numbers

后端 未结 2 1084
误落风尘
误落风尘 2021-01-28 19:43

I am trying to fill my array with random numbers using the following piece of code

#include
#include

int main(){
int n = 5;
int li         


        
2条回答
  •  温柔的废话
    2021-01-28 20:22

    If a random hardware device is not available to the implementation, a pseudo random number engine is used. Is a random number hardware device available? By that, I mean not only physically there, but also available to that particular implementation of std::random_device.

提交回复
热议问题