久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='hNVdf'></bdo><ul id='hNVdf'></ul>

    <small id='hNVdf'></small><noframes id='hNVdf'>

    <legend id='hNVdf'><style id='hNVdf'><dir id='hNVdf'><q id='hNVdf'></q></dir></style></legend>
    1. <i id='hNVdf'><tr id='hNVdf'><dt id='hNVdf'><q id='hNVdf'><span id='hNVdf'><b id='hNVdf'><form id='hNVdf'><ins id='hNVdf'></ins><ul id='hNVdf'></ul><sub id='hNVdf'></sub></form><legend id='hNVdf'></legend><bdo id='hNVdf'><pre id='hNVdf'><center id='hNVdf'></center></pre></bdo></b><th id='hNVdf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hNVdf'><tfoot id='hNVdf'></tfoot><dl id='hNVdf'><fieldset id='hNVdf'></fieldset></dl></div>
      <tfoot id='hNVdf'></tfoot>
    2. 在 C++ 應用程序中,我應該多久調用一次 srand()

      How often should I call srand() in a C++ application?(在 C++ 應用程序中,我應該多久調用一次 srand()?)

      1. <tfoot id='B1yKb'></tfoot>
        • <bdo id='B1yKb'></bdo><ul id='B1yKb'></ul>

          <small id='B1yKb'></small><noframes id='B1yKb'>

                <i id='B1yKb'><tr id='B1yKb'><dt id='B1yKb'><q id='B1yKb'><span id='B1yKb'><b id='B1yKb'><form id='B1yKb'><ins id='B1yKb'></ins><ul id='B1yKb'></ul><sub id='B1yKb'></sub></form><legend id='B1yKb'></legend><bdo id='B1yKb'><pre id='B1yKb'><center id='B1yKb'></center></pre></bdo></b><th id='B1yKb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='B1yKb'><tfoot id='B1yKb'></tfoot><dl id='B1yKb'><fieldset id='B1yKb'></fieldset></dl></div>
                  <tbody id='B1yKb'></tbody>
              • <legend id='B1yKb'><style id='B1yKb'><dir id='B1yKb'><q id='B1yKb'></q></dir></style></legend>

                本文介紹了在 C++ 應用程序中,我應該多久調用一次 srand()?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一個 C++ 應用程序,它在不同的地方調用 rand().我是否需要定期初始化 srand() 以確保 rand() 是合理隨機的,還是在應用程序啟動時調用一次就足夠了?

                I have a C++ application which calls rand() in various places. Do I need to initialize srand() regularly to ensure that rand() is reasonably random, or is it enough to call it once when the app starts?

                推薦答案

                如果您只有一個線程,請一次.如果您經常重新播種,實際上可能會破壞隨機數的某些統計特性.如果您有多個線程,則根本不要使用 rand,而是使用諸如 drand48_r 之類的線程安全的東西,它可以讓您保持每個線程的狀態(因此您可以播種一次每個線程).

                If you have only a single thread, seed once. If you reseed often, you might actually break some of the statistical properties of the random numbers. If you have multiple threads, don't use rand at all, but rather something threadsafe like drand48_r, which lets you maintain a per-thread state (so you can seed once per thread).

                這篇關于在 C++ 應用程序中,我應該多久調用一次 srand()?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡單方法?)
                Reading from .txt file into two dimensional array in c++(從 .txt 文件讀取到 C++ 中的二維數組)
                How to simulate a key press in C++(如何在 C++ 中模擬按鍵按下)
                Why doesn#39;t getline(cin, var) after cin.ignore() read the first character of the string?(為什么在 cin.ignore() 之后沒有 getline(cin, var) 讀取字符串的第一個字符?)
                What is the cin analougus of scanf formatted input?(scanf 格式輸入的 cin 類比是什么?)

                  • <bdo id='0STDg'></bdo><ul id='0STDg'></ul>
                  • <legend id='0STDg'><style id='0STDg'><dir id='0STDg'><q id='0STDg'></q></dir></style></legend>

                    <small id='0STDg'></small><noframes id='0STDg'>

                        <tfoot id='0STDg'></tfoot>
                          <i id='0STDg'><tr id='0STDg'><dt id='0STDg'><q id='0STDg'><span id='0STDg'><b id='0STDg'><form id='0STDg'><ins id='0STDg'></ins><ul id='0STDg'></ul><sub id='0STDg'></sub></form><legend id='0STDg'></legend><bdo id='0STDg'><pre id='0STDg'><center id='0STDg'></center></pre></bdo></b><th id='0STDg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0STDg'><tfoot id='0STDg'></tfoot><dl id='0STDg'><fieldset id='0STDg'></fieldset></dl></div>
                            <tbody id='0STDg'></tbody>

                          主站蜘蛛池模板: a级片免费观看 | 黄色高清网站 | www.天天操 | av免费网站| 亚洲h视频 | 一区二区国产精品 | 三级在线播放 | 九九热视频在线观看 | 欧美一区不卡 | 日本精品网站 | 精品| 99精品久久久久久中文字幕 | 精品国产区 | 色婷婷六月 | 99久久久国产精品 | 久久精品欧美一区 | 国产精品亚洲综合 | 亚洲欧洲视频 | 狠狠操网 | 在线免费看黄色 | 中文字幕在线播放视频 | 中文字幕日韩一区 | 一区二区三区视频在线播放 | www.亚洲视频 | 三级黄色在线观看 | 国产伦理一区 | 黄色大片av | 成人在线免费av | 国产欧美精品一区 | 免费看黄色大片 | 久久av网站 | 日本精品视频 | 超碰成人在线观看 | 国产高清免费 | 国产成人精品网站 | 欧美精品综合 | 成人一区二区三区 | 日本欧美久久久久免费播放网 | 欧美日韩综合网 | 成人黄色免费 | av网站在线看 |