lavendery

标识符:

    在程序中使用的变量名、常量名、函数名、标号、语句块等统称为标识符

    定义规则:

  • 只能包含数字字母下划线,可以以字母a~z,A~Z或者下划线开头。
  • 不能以数字开头。
  • 不能是C语言中保留的关键字,因为其有特殊意义,不能作为标识符。
  • 标识符的长度,C89规定31个字符以内,C99规定63个字符以内。

        (如:

                    类型说明保留字:int, long, short, float, double, char, unsigned, signed, const,

                                                  void, volatile, enum,struct, union

                    语句定义保留字:if, else, goto, switch, case, do, while, for, continue, break, return,

                                                  default, typedef

                    存储类说明保留字:auto, register, static, extern

               

*以上关键字归类来自:https://blog.csdn.net/hitwhylz/article/details/9391633

 

             例如a, x, -b, s*, BOOK_4, sum7

                         其中,a, x, BOOK_4, sum7为合法标识符,-b, s*为非法标识符。

 


如有问题欢迎指出!

2021/9/25       

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-17
  • 2022-01-29
  • 2021-12-17
  • 2021-11-23
  • 2022-02-07
猜你喜欢
  • 2022-01-02
  • 2021-12-24
  • 2022-01-22
  • 2022-12-23
  • 2022-01-21
  • 2022-01-23
相关资源
相似解决方案