How to get current seed from C++ rand()?

前端 未结 8 738
名媛妹妹
名媛妹妹 2020-12-31 01:49

I generate a few thousand object in my program based on the C++ rand() function. Keeping them in the memory would be exhaustive. Is there a way to copy the CURRENT

8条回答
  •  攒了一身酷
    2020-12-31 02:12

    Does anyone know other random number generators with implemented seed-stealer

    All standard C++11 random number generators (also available in TR1 and in Boost) offer this functionality. You can simply copy the generator objects or serialize/deserialize them.

提交回复
热议问题