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

    <tfoot id='JMVe8'></tfoot>

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

      • <bdo id='JMVe8'></bdo><ul id='JMVe8'></ul>

        评论会被翻译成机器码吗?C++

        时间:2023-10-17
          • <small id='NdtYl'></small><noframes id='NdtYl'>

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

                • <tfoot id='NdtYl'></tfoot>
                • <legend id='NdtYl'><style id='NdtYl'><dir id='NdtYl'><q id='NdtYl'></q></dir></style></legend>

                  本文介绍了评论会被翻译成机器码吗?C++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当一个用 C++ 编写的程序有注释时,这些注释是被翻译成机器语言还是永远不会那么远?如果我编写了一个 C++ 程序,在两个命令之间添加了整本书的注释,我的程序是否需要更长的时间来编译或运行更慢?

                  When a program written in C++ has comments, are those comments translated into machine language or do they never get that far? If I write a C++ program with an entire book amount of comments between two commands, will my program take longer to compile or run any slower?

                  推荐答案

                  注释通常在预处理期间被删除,因此编译器本身根本看不到它们.

                  Comments are normally stripped out during preprocessing, so the compiler itself never sees them at all.

                  它们可以(并且通常会)稍微减慢编译速度——预处理器必须通读整个注释才能找到它的结尾(因此后续代码将传递给编译器.除非您包含真正庞大的注释(例如, 兆字节)但差异可能不会很明显.

                  They can (and normally do) slow compilation a little though--the preprocessor has to read through the entire comment to find its end (so subsequent code will be passed through to the compiler. Unless you include truly gargantuan comments (e.g., megabytes) the difference probably won't be very noticeable though.

                  尽管我从未见过(或听说过)这样做的 C 或 C++ 编译器,但已经有编译器(例如,用于 Pascal)使用特殊格式的注释将指令传递给编译器.例如,Turbo Pascal 允许(并且它的后继者可能仍然允许)用户在注释中使用编译器指令打开和关闭范围检查.在这种情况下,注释本身没有(至少在我知道的情况下)没有生成任何机器代码,但它可能并且确实影响了为注释之外的代码生成的机器代码.

                  Although I've never seen (or heard of) a C or C++ compiler that did it, there have been compilers (e.g., for Pascal) that used specially formatted comments to pass directives to the compiler. For example, Turbo Pascal allowed (and its successor probably still allows) the user to turn range checking on and off using a compiler directive in a comment. In this case, the comment didn't (at least in the cases of which I'm aware) generate any machine code itself, but it could and did affect the machine code that was generated for the code outside the comment.

                  这篇关于评论会被翻译成机器码吗?C++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我如何通过终端命令在 mac 上编译它 下一篇:什么是德尔福 DCU 文件?

                  相关文章

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

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

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