Identifiers:
Identifiers are names that are given to various program elements, such as variables, functions and arrays. These are user-defined. Identifiers consist of letters, digits and some characters but the first letter must be a letter. Generally lowercase letter is used but uppercase letter can also be used. Uppercase and lowercase letters are not interchangeable.
Identifiers are names that are given to various program elements, such as variables, functions and arrays. These are user-defined. Identifiers consist of letters, digits and some characters but the first letter must be a letter. Generally lowercase letter is used but uppercase letter can also be used. Uppercase and lowercase letters are not interchangeable.
Identifiers can be of any length but typically it accepts 31 characters.
The following names are valid identifiers.
-
a x xy firstname lastName area_of_circle _length test18
18test The first character must be a letter
"xx" Illegal character "
first name Blank space
last-name Illegal character -
Keywords:
In C programming language, there are some certain reserve words. These reserve words are called Keyword. Keywords can be used only in particular purpose that is defined in language. So, keywords cannot be used as identifiers. Keywords have standard predefined meanings.
C keyword list is below:
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
continue | for | signed | void |
do | if | static | while |
default | goto | sizeof | volatile |
const | float | short | unsigned |
Note that the keywords are all lowercase. Since uppercase and lowercase characters are not equivalent, it is possible to utilize an uppercase keyword as an identifier. Normally, however, this is not done, as it is considered a poor programming practice.
No comments:
Post a Comment