What's the Right Way to use the rand() Function in C++?

后端 未结 5 1139
生来不讨喜
生来不讨喜 2020-11-29 12:16

I\'m doing a book exercise that says to write a program that generates psuedorandom numbers. I started off simple with.

#include \"std_lib_facilities.h\"

in         


        
5条回答
  •  一生所求
    2020-11-29 13:01

    I think that the point of these articles is to have a go at implementing the algorithm that is in rand() not how to seed it effectively.

    producing (pseudo) random numbers is non trivial and is worth investigating different techniques of generating them. I don't think that simply using rand() is what the authors had in mind.

提交回复
热议问题