C Reference Manual Reading Notes: 005 Tokens ( Without Constants )

本文详细介绍了C语言中的五种标记:运算符、分隔符、标识符、关键字和常量。重点讲解了标识符的命名规则,包括合法字符、大小写敏感性、保留标识符等内容,并列举了所有C语言的关键字。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    Five classes of tokens: operators, separators, identifiers, keywords, and constants.

 

    (1) operators and separators.

             ! % ^ & * - + = ~ | . < > / ?

             += -= *= /= %=

             <<= >>= &= ^= |=

             --> ++ -- << >>

             <= >= == != && ||

             () [] {} , ; : ...

             <% %> <: :> %: %:%: (see the section 001)

 

    (2) identifiers

             (a).  An identifier, or name, is a sequence of Latin capital and small letters, digits, and LOWLINE character. An identifier must bot begin with a digit, and it must not have the same spelling as a keyword.

             (b). Beginning with C99, identifiers may also contain unversal character names and other implementation-defined multibyte characters. Unversal characters must not be used to place a diagit at the beginning of an identifier and further restricted to be "letter-like" character and not puncuators.

             (c). Identifiers sensitive of case.

             (d). All identifiers may not beginning with an underscore and followed by ethier a capital(uppercase) letter or another underscore because which all are reserved for standard library.

             (e). Internal identidfiers: C89 requires implementation to permit a minimum of 31 significant character in identifiers, and C99 raises this minimum to 63 characters.

             (f). External identifiers: C89 requires a minimum capacity of only six characters, not counting letter case. C99 raises this to 31 characters, including letter case. But allowing unversal character names to be treated as 6 characters or 10 characters.

 

    (3). Keywords

              auto _Bool break case char _Complex const continue default restrict do double

              else enum extern float for goto if _Imaginary inline int long register return short

              signed sizeof static struct switch typedef union unsigned void volatile while

 

    (4). Constants. It's more complicated than forwards. The next section will note the constants.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值