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

      <bdo id='cIHl0'></bdo><ul id='cIHl0'></ul>

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

    1. 在字符串文字中展开宏

      时间:2023-10-06

      • <bdo id='DbIUH'></bdo><ul id='DbIUH'></ul>
        <tfoot id='DbIUH'></tfoot>

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

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

                本文介绍了在字符串文字中展开宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我想要做的是#define一个宏:

                #define a(2)
                

                然后在字符串文字中使用它:string = "a";.

                and later use it inside a string literal: string = "a";.

                我希望该字符串不被解释为字符串,而是获取a的值,即2.我没有成功,有人可以帮忙吗?

                I want that string to be interpreted not as string but to get the value of a, i.e. 2. I didn't succeed, can anybody help?

                推荐答案

                #define STRINGIFY2(X) #X
                #define STRINGIFY(X) STRINGIFY2(X)
                #define A 2
                

                然后STRINGIFY(A)会给你"2".您可以通过将它们并排放置来将其与其他字符串文字连接起来.

                Then STRINGIFY(A) will give you "2". You can concatenate it with other string literals by putting them side by side.

                我有数字STRINGIFY(A)"." 给你 我有数字 2.".

                这篇关于在字符串文字中展开宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:C4250 VC++ 警告是什么意思? 下一篇:如何增加 Visual Studio 中的错误限制?

                相关文章

                最新文章

                  <tfoot id='nW6io'></tfoot>
                    <bdo id='nW6io'></bdo><ul id='nW6io'></ul>

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

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