Home>Article>Backend Development> What are the three types of identifiers in C language?

What are the three types of identifiers in C language?

王林
王林 Original
2020-11-10 16:42:53 18858browse

C language identifiers include keywords, user identifiers, and predefined identifiers. The C language stipulates that identifiers can only be composed of letters, numbers, and underscores, and the first character must be a letter or an underscore, not a number.

What are the three types of identifiers in C language?

#Identifiers in C language can be divided into three categories: keywords, user identifiers, and predefined identifiers.

(Learning video sharing:java video tutorial)

C language stipulates that identifiers can only consist of letters (A~Z, a~z), It consists of numbers (0~9) and underscores (_), and the first character must be a letter or an underscore, not a number.

You must also pay attention to the following points when using identifiers:

1. Although the C language does not limit the length of identifiers, it is restricted by different compilers and also by the operating system. limits. For example, a certain compiler stipulates that the first 128 bits of an identifier are valid. When the first 128 bits of two identifiers are the same, they are considered to be the same identifier.

2. In identifiers, there is a difference between upper and lower case. For example, BOOK and book are two different identifiers.

3. Although identifiers can be defined arbitrarily by programmers, identifiers are symbols used to identify a certain quantity. Therefore, the naming should have corresponding meanings as much as possible to facilitate reading and understanding, and achieve "as the name implies" ".

Related recommendations:C language tutorial

The above is the detailed content of What are the three types of identifiers in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn