Identifiers in C
Identifier define to name given to entities such as variables, functions, structures etc.
See in Example.
Here a and accountBalance is identifiers.
Here int is keyword
Rules for Identifiers
- An 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.
- Commas or blank spaces cannot be specified within an identifier.
- Keywords cannot be represented as an identifier.
Differences between Keyword and Identifier
Keyword |
Identifier |
Keyword is a pre-defined word. |
The identifier is a user-defined word |
It must be written in a lowercase letter. |
It can be written in both lowercase and uppercase letters. |
Its meaning is pre-defined in the c compiler. |
Its meaning is not defined in the c compiler. |
It is a combination of alphabetical characters. |
It is a combination of alphanumeric characters. |
It does not contain the underscore character. |
It can contain the underscore character. |
Example:
Output
Value of a is : 5
Value of A is :10
|