c語言-關鍵字/標識符

 

關鍵字的基本概念

  • 被c語言賦予了特殊的含義的單詞xcode

    • 關鍵字特徵:所有都是小寫
    • 關鍵字在xcode中顯示爲特殊的顏色
    • 注意:關鍵字區分大小寫,關鍵字不能用作變量名
  • c語言中一共有32個關鍵字spa

  • 數據類型關鍵字(12個)code

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

  • 控制語句關鍵字(12個)get

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

  • 存儲關鍵字(5個)io

    ​ auto,extern,register,static,constclass

  • 其它關鍵字(3個)變量

    ​ sizeof,typedef,volatile數據類型

注意

  • 千萬不要死記硬背關鍵字,沒用,看看就得了

註釋

  • 單行註釋

    // printf("hello world");
  • 多行註釋

    /*int main()
    {
        printf("hello world")
    }
    */
  • 寫代碼必定要寫註釋,切記切記

  • 註釋的嵌套沒啥用

相關文章
相關標籤/搜索