• <small id='GYRnK'></small><noframes id='GYRnK'>

    1. <legend id='GYRnK'><style id='GYRnK'><dir id='GYRnK'><q id='GYRnK'></q></dir></style></legend>

      1. <tfoot id='GYRnK'></tfoot>
        <i id='GYRnK'><tr id='GYRnK'><dt id='GYRnK'><q id='GYRnK'><span id='GYRnK'><b id='GYRnK'><form id='GYRnK'><ins id='GYRnK'></ins><ul id='GYRnK'></ul><sub id='GYRnK'></sub></form><legend id='GYRnK'></legend><bdo id='GYRnK'><pre id='GYRnK'><center id='GYRnK'></center></pre></bdo></b><th id='GYRnK'></th></span></q></dt></tr></i><div id='GYRnK'><tfoot id='GYRnK'></tfoot><dl id='GYRnK'><fieldset id='GYRnK'></fieldset></dl></div>
        • <bdo id='GYRnK'></bdo><ul id='GYRnK'></ul>

      2. 我是否必须使用 #include &lt;string&gt;在 &lt;iostream&am

        Do I have to use #include lt;stringgt; beside lt;iostreamgt;?(我是否必须使用 #include lt;stringgt;在 lt;iostreamgt; 旁边?)
        <tfoot id='21N6J'></tfoot>

                <bdo id='21N6J'></bdo><ul id='21N6J'></ul>
                  <tbody id='21N6J'></tbody>

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

                • <small id='21N6J'></small><noframes id='21N6J'>

                  本文介绍了我是否必须使用 #include &lt;string&gt;在 &lt;iostream&gt; 旁边?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我开始学习 C++,我读了一本书,书中写道我必须使用 <string> 头文件,因为字符串类型不是直接内置到编译器中的.如果我使用 我可以使用字符串类型.

                  I started learning C++ and I read a book which writes that I must use the <string> header file because the string type is not built directly into the compiler. If I use the <iostream> I can use the string type.

                  如果我包含 标头,当我想使用字符串类型时,是否必须包含 标头?为什么?有什么区别吗?

                  Do I have to include the <string> header when I want to use the string type if I included the <iostream> header? Why? Is there some difference?

                  推荐答案

                  是的,您必须包含您使用的内容.标准头相互包含并不是强制性的(IIRC 除外).它现在可能可以工作,但在不同的编译器上可能会失败.

                  Yes, you have to include what you use. It's not mandated that standard headers include one another (with a few exceptions IIRC). It might work now, but might fail on a different compiler.

                  在您的情况下,显然 包括 ,直接或间接,但不要依赖它.

                  In your case, apparently <iostream> includes <string>, directly or indirectly, but don't rely on it.

                  这篇关于我是否必须使用 #include &lt;string&gt;在 &lt;iostream&gt; 旁边?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                  How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                  Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                  Delay Loading DLLs(延迟加载 DLL)
                  Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                  Loading a dll from a dll?(从 dll 加载 dll?)
                    • <legend id='o49uA'><style id='o49uA'><dir id='o49uA'><q id='o49uA'></q></dir></style></legend>

                        • <small id='o49uA'></small><noframes id='o49uA'>

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