CBCS C Programming Keywords and Identifiers
Dear friends, Here you will learn about CBCS C Programming Keywords and Identifiers, here keywords; reserved words in C programming that are part of the syntax. Also, you will learn about identifiers and proper way to name a variable.
# C Character set
Character set is a set of alphabets, letters and some special characters that are valid in C language.
Alphabets
Uppercase: A B C ................................... X Y Z Lowercase: a b c ...................................... x y z
C accepts both lowercase and uppercase alphabets as variables and functions.
Digits
0 1 2 3 4 5 6 7 8 9
Special Characters
, | < | > | . | _ |
( | ) | ; | $ | : |
% | [ | ] | # | ? |
‘ | & | { | } | “ |
^ | ! | * | / | | |
– | \ | ~ | + |
White space Characters
blank space, new line, horizontal tab, carriage return and form feed
# C Keywords
Keywords are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are part of the syntax and they cannot be used as an identifier. For example:
int money; double accountBalance;
Here, money and accountBalance are identifiers.
Also remember, identifier names must be different from keywords. You cannot use intas an identifier because int is a keyword.
# Rules for writing an identifier
- 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. However, it is discouraged to start an identifier name with an underscore.
- There is no rule on length of an identifier. However, the first 31 characters of identifiers are discriminated by the compiler.
# Good Programming Practice
You can choose any name for an identifier (excluding keywords). However, if you give meaningful name to an identifier, it will be easy to understand and work on for you and your fellow programmers.
We hope you enjoyed to read this article. If you have any questions, please comment below!