<tfoot id='kH0Ur'></tfoot>

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

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

    2. <legend id='kH0Ur'><style id='kH0Ur'><dir id='kH0Ur'><q id='kH0Ur'></q></dir></style></legend>
        <bdo id='kH0Ur'></bdo><ul id='kH0Ur'></ul>

      1. 有没有办法在 C++ 源代码中用空格编写大量数字以使其更具可读性?

        时间:2023-09-27

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

              • <bdo id='Kx12r'></bdo><ul id='Kx12r'></ul>
              • <tfoot id='Kx12r'></tfoot>
                  <tbody id='Kx12r'></tbody>

                1. <small id='Kx12r'></small><noframes id='Kx12r'>

                  本文介绍了有没有办法在 C++ 源代码中用空格编写大量数字以使其更具可读性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  假设我有代码:

                  vector<int> temp = vector<int>(1 000 000 000);
                  

                  以上不会编译,因为编译器会抱怨空格.是否可以指示 C++ 在编译时省略这些空格,或者以其他方式使数字更易于阅读?

                  The above will not compile as the compiler will complain about the spaces. Is it possible to indicate to C++ to ommit those spaces when compiling, or otherwise make the number easier to read?

                  推荐答案

                  试试数字分隔符:

                  int i = 1'000'000'000;
                  

                  此功能是 自 C++14 引入的.它使用单引号 (') 作为数字分隔符.

                  This feature is introduced since C++14. It uses single quote (') as digit separator.

                  另见:

                  • 为什么没有为 C++14 数字分隔符选择空格字符?
                  • 泛化 C++2000 的重载(C++ 之父 4 月的笑话)
                  • Why was the space character not chosen for C++14 digit separators?
                  • Generalizing Overloading for C++2000 (April's joke by the father of C++ himself)

                  这篇关于有没有办法在 C++ 源代码中用空格编写大量数字以使其更具可读性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:为什么这会调用默认构造函数? 下一篇:为什么 cin 命令会在缓冲区中留下一个 ' '?

                  相关文章

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

                    1. <tfoot id='6FrwR'></tfoot>
                        <bdo id='6FrwR'></bdo><ul id='6FrwR'></ul>

                    2. <small id='6FrwR'></small><noframes id='6FrwR'>