• <bdo id='8mQWM'></bdo><ul id='8mQWM'></ul>

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

        <tfoot id='8mQWM'></tfoot>

        <small id='8mQWM'></small><noframes id='8mQWM'>

      1. C中EOF和''的值是什么

        What is value of EOF and #39;#39; in C(C中EOF和的值是什么)
      2. <i id='WGO6C'><tr id='WGO6C'><dt id='WGO6C'><q id='WGO6C'><span id='WGO6C'><b id='WGO6C'><form id='WGO6C'><ins id='WGO6C'></ins><ul id='WGO6C'></ul><sub id='WGO6C'></sub></form><legend id='WGO6C'></legend><bdo id='WGO6C'><pre id='WGO6C'><center id='WGO6C'></center></pre></bdo></b><th id='WGO6C'></th></span></q></dt></tr></i><div id='WGO6C'><tfoot id='WGO6C'></tfoot><dl id='WGO6C'><fieldset id='WGO6C'></fieldset></dl></div>
        <tfoot id='WGO6C'></tfoot>
          <tbody id='WGO6C'></tbody>

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

              <legend id='WGO6C'><style id='WGO6C'><dir id='WGO6C'><q id='WGO6C'></q></dir></style></legend>

                  <bdo id='WGO6C'></bdo><ul id='WGO6C'></ul>
                • 本文介绍了C中EOF和''的值是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道 EOF'' 是整数类型,但如果是这样,它们不应该有一个固定值吗?

                  I know that EOF and '' are of type integers, but if so shouldn't they have a fixed value?

                  我打印了两者,EOF 得到 -1,'' 得到 0.但是这些值是固定的吗?

                  I printed both and got -1 for EOF and 0 for ''. But are these values fixed?

                  我也有这个

                  int a=-1;
                  
                  printf("%d",a==EOF); //printed 1
                  

                  EOF'' 的值是固定整数吗?

                  Are the value for EOF and '' fixed integers?

                  推荐答案

                  EOF 是一个宏,它扩展为一个整数常量表达式,类型为 int 和一个依赖于实现的负数值但很常见 -1.

                  EOF is a macro which expands to an integer constant expression with type int and an implementation dependent negative value but is very commonly -1.

                  '' 是 C++ 中值为 0 的 char 和 C 中值为 0 的 int .

                  '' is a char with value 0 in C++ and an int with the value 0 in C.

                  printf("%d",a==EOF); 导致1的原因是你没有赋值EOFa.相反,您检查 a 是否等于 EOF 并且因为这是真的 (a == -1 == EOF) 它打印了 1.

                  The reason why printf("%d",a==EOF); resulted in 1 was because you didn't assign the value EOF to a. Instead you checked if a was equal to EOF and since that was true (a == -1 == EOF) it printed 1.

                  这篇关于C中EOF和''的值是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                  C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                  Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                  Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                  What is a dangling reference?(什么是悬空引用?)
                  C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)
                    <tbody id='Qk83Y'></tbody>

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

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

                        <tfoot id='Qk83Y'></tfoot>