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

<legend id='eeQBh'><style id='eeQBh'><dir id='eeQBh'><q id='eeQBh'></q></dir></style></legend>

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

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

    <tfoot id='eeQBh'></tfoot>

        M_PI 適用于 math.h 但不適用于 Visual Studio 中的 cm

        M_PI works with math.h but not with cmath in Visual Studio(M_PI 適用于 math.h 但不適用于 Visual Studio 中的 cmath)

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

              <tfoot id='iFeTs'></tfoot>
                <tbody id='iFeTs'></tbody>

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

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

                  本文介紹了M_PI 適用于 math.h 但不適用于 Visual Studio 中的 cmath的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我使用的是 Visual Studio 2010.我讀到在 C++ 中最好使用 而不是 .

                  I am using Visual Studio 2010. I have read that in C++ it is better to use <cmath> rather than <math.h>.

                  但是在我嘗試編寫的程序中(Win32 控制臺應用程序,空項目)如果我寫:

                  But in the program I am trying to write (Win32 console application, empty project) if I write:

                  #define _USE_MATH_DEFINES
                  #include <math.h>
                  

                  它編譯,而如果我寫

                  #define _USE_MATH_DEFINES
                  #include <cmath>
                  

                  它失敗了

                  錯誤 C2065:'M_PI':未聲明的標識符

                  error C2065: 'M_PI' : undeclared identifier

                  正常嗎?我使用 cmath 還是 math.h 有關系嗎?如果是,我怎樣才能讓它與 cmath 一起工作?

                  Is it normal? Does it matter if I use cmath or math.h? If yes, how can I make it work with cmath?

                  UPDATE:如果我在 GUI 中定義 _USE_MATH_DEFINES,它就可以工作.知道為什么會這樣嗎?

                  UPDATE: if I define _USE_MATH_DEFINES in the GUI, it works. Any clue why this is happening?

                  推薦答案

                  有趣的是,我在我的一個應用上檢查了這個,我得到了同樣的錯誤.

                  Interestingly I checked this on an app of mine and I got the same error.

                  我花了一段時間檢查標題,看看是否有任何未定義的 _USE_MATH_DEFINES 內容,但一無所獲.

                  I spent a while checking through headers to see if there was anything undef'ing the _USE_MATH_DEFINES and found nothing.

                  所以我移動了

                  #define _USE_MATH_DEFINES
                  #include <cmath>
                  

                  成為我文件中的第一件事(我不使用 PCH,所以如果你是,你必須在 #include "stdafx.h" 之后使用它),突然它完美編譯.

                  to be the first thing in my file (I don't use PCHs so if you are you will have to have it after the #include "stdafx.h") and suddenly it compile perfectly.

                  嘗試將其移到頁面更高的位置.完全不確定為什么這會導致問題.

                  Try moving it higher up the page. Totally unsure as to why this would cause issues though.

                  編輯:想通了.#include <math.h> 出現在 cmath 的頭文件保護中.這意味著在#includes 列表的更高層包含cmath,但沒有指定#define.math.h 是專門設計的,因此您可以再次包含它,現在定義更改為添加 M_PI 等.cmath 不是這種情況>.因此,在包含其他任何內容之前,您需要確保 #define _USE_MATH_DEFINES.希望能幫到你:)

                  Edit: Figured it out. The #include <math.h> occurs within cmath's header guards. This means that something higher up the list of #includes is including cmath without the #define specified. math.h is specifically designed so that you can include it again with that define now changed to add M_PI etc. This is NOT the case with cmath. So you need to make sure you #define _USE_MATH_DEFINES before you include anything else. Hope that clears it up for you :)

                  如果僅包含 math.h 失敗,您將使用非標準 C/C++,正如已經指出的 :)

                  Failing that just include math.h you are using non-standard C/C++ as already pointed out :)

                  編輯 2:或者正如大衛在評論中指出的那樣,讓自己成為一個定義值的常量,并且無論如何你都有更便攜的東西:)

                  Edit 2: Or as David points out in the comments just make yourself a constant that defines the value and you have something more portable anyway :)

                  這篇關于M_PI 適用于 math.h 但不適用于 Visual Studio 中的 cmath的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Why do two functions have the same address?(為什么兩個函數的地址相同?)
                  Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復制構造的?)
                  mixing templates with polymorphism(混合模板與多態性)
                  When should I use the keyword quot;typenamequot; when using templates(我什么時候應該使用關鍵字“typename?使用模板時)
                  Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標準庫)
                  gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數模板,而 clang 不能)

                    <bdo id='GjIk9'></bdo><ul id='GjIk9'></ul>
                        <tbody id='GjIk9'></tbody>

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

                            <tfoot id='GjIk9'></tfoot>
                            主站蜘蛛池模板: 久久久久综合 | 国产成人网 | 特黄特黄a级毛片免费专区 av网站免费在线观看 | 色综久久| 精品在线一区 | 久久精品国内 | 欧美成人第一页 | 亚洲国产精久久久久久久 | 久久精品视频在线观看 | 精品在线视频播放 | 亚洲精品乱码8久久久久久日本 | 91精品在线观看入口 | 国产欧美日韩视频 | 国产伦精品一区二区三区在线 | 成人精品| 在线视频 亚洲 | 久久久久亚洲精品中文字幕 | 毛片在线免费 | 日韩福利在线 | 香蕉久久久 | 欧美激情a∨在线视频播放 成人免费共享视频 | 色吧综合 | 天堂亚洲 | 精品久久免费 | 久久国产美女视频 | 青青草社区 | 日韩a级片| 天天插天天舔 | 日本一区二区在线视频 | 欧美日韩精选 | 婷婷91| 男女羞羞免费视频 | 免费成人在线网站 | 国产精品高清一区二区三区 | 国产免费一区二区 | 国产精品福利一区二区三区 | 一区二区免费在线视频 | av中文天堂 | 亚洲二区视频 | 九九视频在线观看 | 国内精品视频在线观看 |