C Keywords and Identifiers
Keywords :
- Keywords are the reserve words which can not be used as variables.
- These are the sytem defined variables.
- C++ has many different keywords.
- White spaces are not allowed in keywords.
- These are in lower case.
int | float | double | long |
short | signed | unsigned | const |
if | else | switch | break |
default | do | while | for |
register | extern | static | struct |
typedef | enum | return | sizeof |
goto | union | auto | case |
void | char | continue | volatile |
Identifiers :
- These are the words or names which identify whether it is a constant, variable or function name in C.
- It reprsent unique sequence of characters.
- These must be maximum upto 31 characters long.
- All the identifiers are case sensitive.
- Special characters or keywords should not be used as indentifiers.
- Only alphabet characters, digits and underscores are permitted.
- The name can't be started with digit.
- The keyword can't be used as a name.
- These are case sensitive.
- Identifier name can't have space.
- The name can't have a special character.
Following are some valid identifiers :
number, number1, x, xyz etc.
following are the Invalid identifiers :
7xy(first letter is digit), first name(has space), break(reserve word)
Prev NEXT
0 comments:
Post a Comment