c语言-关键字/标识符

关键字的基本概念

  • 被c语言赋予了特殊的含义的单词

    • 关键字特征:全部都是小写
    • 关键字在xcode中显示为特殊的颜色
    • 注意:关键字区分大小写,关键字不能用做变量名
  • c语言中一共有32个关键字

  • 数据类型关键字(12个)

    ​ char,short,int,long,float,double,unsigned,signed,struct,union,enum,void

  • 控制语句关键字(12个)

    ​ if,else,switch,case,default,for,do,while,break,continue,goto,return

  • 存储关键字(5个)

    ​ auto,extern,register,static,const

  • 其它关键字(3个)

    ​ sizeof,typedef,volatile

注意

  • 千万不要死记硬背关键字,没用,看看就得了

注释

  • 单行注释

    // printf("hello world");
    
  • 多行注释

    /*int main()
    {
        printf("hello world")
    }
    */
    
  • 写代码一定要写注释,切记切记

  • 注释的嵌套没啥用


原文地址:https://www.cnblogs.com/shanshan-test/p/12833145.html