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

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

      1. <tfoot id='tKRBA'></tfoot>

      2. <legend id='tKRBA'><style id='tKRBA'><dir id='tKRBA'><q id='tKRBA'></q></dir></style></legend>

      3. C++ 字符串字面量数据类型存储

        时间:2023-09-17
          <tbody id='v6UgH'></tbody>

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

              <tfoot id='v6UgH'></tfoot>

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

                  <legend id='v6UgH'><style id='v6UgH'><dir id='v6UgH'><q id='v6UgH'></q></dir></style></legend>
                  本文介绍了C++ 字符串字面量数据类型存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  void f()
                  {
                      char *c = "Hello World!"
                  }
                  

                  字符串存储在哪里?它的属性是什么?我只知道它是一个常数,还有什么?我可以从函数体内部返回它吗?

                  Where is the string stored? What's the property of it? I just know it is a constant, what else? Can I return it from inside of the function body?

                  推荐答案

                  它与你的二进制文件打包在一起——我所说的打包是指硬接线,所以是的,你可以返回它并在其他地方使用它——你不会能够改变它,我强烈建议你将其声明为:

                  it is packaged with your binary -- by packaged I mean hard-wired, so yes you can return it and use it elsewhere -- you won't be able to alter it though, and I strongly suggest you declare it as:

                  const char * x = "hello world";
                  

                  这篇关于C++ 字符串字面量数据类型存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:std::deque 的内存开销是怎么回事? 下一篇:什么是“位填充"?或“填充位"确切地?

                  相关文章

                  最新文章

                    <bdo id='5oMlE'></bdo><ul id='5oMlE'></ul>
                  <tfoot id='5oMlE'></tfoot>

                  <small id='5oMlE'></small><noframes id='5oMlE'>

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