什么是c语言中的扩展关键字
Keywords are preserved words that have special meaning in C language. The meaning of C language keywords has already been described to the C compiler. These meaning cannot be changed. Thus, keywords cannot be used as variable names because that would try to change the existing meaning of the keyword, which is not allowed.(Don't worry if you do not know what variables are, you will soon understand.) There are total 32 keywords in C language.
关键字是在C语言中具有特殊含义的保留单词。 C语言关键字的含义已经向C编译器进行了描述。 这些含义无法更改。 因此,关键字不能用作变量名,因为这会试图更改关键字的现有含义,这是不允许的。(不用担心,如果您不知道什么是变量,很快就会了解。) C语言的32个关键字。
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
const | extern | return | union |
char | float | short | unsigned |
continue | for | signed | volatile |
default | goto | sizeof | void |
do | if | static | while |
汽车 | 双 | 整型 | 结构 |
打破 | 其他 | 长 | 开关 |
案件 | 枚举 | 寄存器 | 类型定义 |
const | 外部 | 返回 | 联盟 |
烧焦 | 浮动 | 短 | 未签名 |
继续 | 对于 | 签 | 易挥发的 |
默认 | 去 | 大小 | 虚空 |
做 | 如果 | 静态的 | 而 |
什么是标识符? (What are Identifiers?)
In C language identifiers are the names given to variables, constants, functions and user-define data. These identifier are defined against a set of rules.
在C语言中,标识符是为变量,常量,函数和用户定义数据指定的名称。 这些标识符是根据一组规则定义的。
标识符规则 (Rules for an Identifier)
An Identifier can only have alphanumeric characters(a-z , A-Z , 0-9) and underscore(
_
).标识符只能包含字母数字字符(az,AZ,0-9)和下划线(
_
)。The first character of an identifier can only contain alphabet(a-z , A-Z) or underscore (
_
).标识符的第一个字符只能包含字母(az,AZ)或下划线(
_
)。Identifiers are also case sensitive in C. For example name and Name are two different identifiers in C.
标识符在C中也区分大小写。例如, name和Name是C中的两个不同标识符。
Keywords are not allowed to be used as Identifiers.
关键字不允许用作标识符。
No special characters, such as semicolon, period, whitespaces, slash or comma are permitted to be used in or as Identifier.
不允许在标识符中使用特殊字符,例如分号,句号,空格,斜杠或逗号。
When we declare a variable or any function in C language program, to use it we must provide a name to it, which identified it throughout the program, for example:
当我们在C语言程序中声明变量或任何函数时,要使用它,我们必须提供一个名称,以在整个程序中对其进行标识,例如:
int myvariable = "Studytonight";
Here myvariable
is the name or identifier for the variable which stores the value "Studytonight" in it.
myvariable
是变量的名称或标识符,该变量在其中存储值“ Studytonight”。
字符集 (Character set)
In C language characters are grouped into the following catagories,
在C语言中,字符分为以下几类:
Letters(all alphabets a to z & A to Z).
字母(所有字母a到z和A到Z)。
Digits (all digits 0 to 9).
数字(所有数字0到9)。
Special characters, ( such as colon
:
, semicolon;
, period.
, underscore_
, ampersand&
etc).特殊字符,(如结肠
:
,分号;
,周期.
,下划线_
,符号&
等)。White spaces.
空白。
Here is a quick video to explain all about keywords and Identifiers.
这是一个简短的视频,解释所有有关关键字和标识符的信息。
翻译自: https://www.studytonight.com/c/keywords-and-identifier.php
什么是c语言中的扩展关键字