프로그래밍 언어/C
Keywords와 Identifiers
bewisesh91
2021. 12. 6. 10:11
728x90
C 언어에서 이미 Keyword로 사용하고 있어서 Identifier(ariables, functions, structures 등)로 사용할 수 없는 것들이 있다.
Rules for naming identifiers
- A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores.
- The first letter of an identifier should be either a letter or an underscore.
- You cannot use keywords like int, while etc. as identifiers.
- There is no rule on how long an identifier can be.
However, you may run into problems in some compilers if the identifier is longer than 31 characters.
You can choose any name as an identifier if you follow the above rule, however, give meaningful names to identifiers that make sense.