zoukankan      html  css  js  c++  java
  • C基础巩固

     1 //看EOF的值
     2 
     3 #include <stdio.h>
     4 #include <stdlib.h>
     5 int main(void)
     6 {
     7 printf("EOF的值用数字表示为:%d
    ", EOF);
     8 system("pause"); 
     9 return 0;
    10 }

     1 //验证getchar()!= EOF的值
     2 
     3 #include <stdio.h>
     4   
     5 int main(void)
     6 {
     7   printf("随便按个键,Ctrl+D或Ctrl+Z代表EOF
    ");
     8   printf("表达式 getchar() != EOF 的值为 %d
    ", getchar()!= EOF);
     9   system("pause");
    10   return 0;
    11 }

    结果:Ctrl+D ---> 1 ; Ctrl + Z ---> 0
    #include <stdio.h>
      
    int main(void)
    {
      //注:建议使用标准的转义字符(
    ,	,,",\之类),如果使用非标准的转义字符,结果将变得不可预期(比如下面的a,f,
    ,v 之类) 
      printf("\Audible or visual alert. a
    ");  
      printf("Form feed. f
    ");
      printf("This escape, 
    , moves the active position to the initial position of the current line.
    ");
      printf("Vertical tab v is tricky, as its behaviour is unspecified under certain conditions.
    ");
      return 0;
    }

    #include <stdio.h>
      
    int main(void)
    {
      printf("EOF的值用数字表示为:%d
    ", EOF);return 0;
    }
    
    结果:-1
  • 相关阅读:
    SIP协议
    Jenkins 使用
    JMeter测试报告
    JMeter接口测试
    JMeter学习2
    JMeter学习1
    Docker
    WebLog Expert
    sqlmap11种常见方法
    网络
  • 原文地址:https://www.cnblogs.com/tangtang-123/p/4492910.html
Copyright © 2011-2022 走看看