久久久久久久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++ 應(yīng)用程序中,我應(yīng)該多久調(diào)用一次 srand()

      How often should I call srand() in a C++ application?(在 C++ 應(yīng)用程序中,我應(yīng)該多久調(diào)用一次 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++ 應(yīng)用程序中,我應(yīng)該多久調(diào)用一次 srand()?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問題描述

                我有一個(gè) C++ 應(yīng)用程序,它在不同的地方調(diào)用 rand().我是否需要定期初始化 srand() 以確保 rand() 是合理隨機(jī)的,還是在應(yīng)用程序啟動(dòng)時(shí)調(diào)用一次就足夠了?

                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?

                推薦答案

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

                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).

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

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

                相關(guān)文檔推薦

                read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡(jiǎn)單方法?)
                Reading from .txt file into two dimensional array in c++(從 .txt 文件讀取到 C++ 中的二維數(shù)組)
                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) 讀取字符串的第一個(gè)字符?)
                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>

                          主站蜘蛛池模板: 欧美电影在线观看网站 | 日本一区二区三区四区 | 欧美激情一区二区 | 一区二区不卡视频 | 日韩在线精品视频 | 91免费入口 | 国产精品99免费视频 | 福利社午夜影院 | 日韩精品视频在线观看一区二区三区 | 中文字幕一二三 | av天天干 | 国产精品毛片一区二区在线看 | 国产二区三区 | 久久激情视频 | 爱爱爱av | 欧美成人专区 | 99这里只有精品视频 | 国产一区二区三区在线看 | 国产中文字幕网 | 欧美一区二区在线播放 | 久久合久久 | 视频一区在线 | 日韩免费在线 | 精品国产一区二区三区久久久蜜月 | 天天色天天 | 中文字幕一级 | 九色91视频| caoporn免费 | 在线观看日韩精品视频 | 国产日韩欧美在线 | 日韩一区二区三区视频在线观看 | 一区二区三区成人 | 久久久久无码国产精品一区 | 自拍第1页| 久久成人一区二区三区 | 午夜电影一区 | 国产精品伦理一区 | 欧美精品一区二区三区蜜臀 | 午夜久久久久久久久久一区二区 | 欧美久久一级特黄毛片 | 亚洲一区二区久久久 |