Home >Backend Development >C#.Net Tutorial >What are the naming rules for user identifiers in C language

What are the naming rules for user identifiers in C language

王林
王林Original
2020-07-20 15:17:2728344browse

The naming rules for user identifiers in C language are: 1. User identifiers must start with the letters a~z, A~Z or an underscore; 2. User identifiers are case-sensitive; 3. C language Keywords in have special meaning and cannot be used as identifiers.

What are the naming rules for user identifiers in C language

User identifiers in C language should generally follow the following naming rules:

(Recommended learning: C Language Tutorial

1. The identifier must start with the letters a~z, A~Z or an underscore, and can be followed by any number (can be 0) characters. These characters can be letters, underscores, numbers, and other characters. It is not allowed to appear in the identifier;

2. Identifiers are case-sensitive;

3. The length of the identifier, c89 stipulates that it should be within 31 characters, and c99 stipulates that it should be within 63 characters;

4. Keywords in C language have special meanings and cannot be used as identifiers;

5. It is best to use a string with a certain meaning for a custom identifier to facilitate memory and understanding.

The above is the detailed content of What are the naming rules for user 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