Identifiers are made up of letters and digits, and are case-sensitive. They are variable names, function name and so on. Keywords are the reserved words in C programming. Exactly same variable cannot defined by the user that are keywords.
Keywords are predefined, reserved words used in programming. They have their own meaning in C programming and their uses are predefined. The C language has 32 keywords which are reserved and may not be used as identifiers
In above example int is the keyword that define variable number as Integer.
Use lowercase for variable names and uppercase for symbolic constants.
Keywords in C
An identifier is a string of alphanumeric characters that begins with an alphabetic character or an underscore character. These are used to represent elements such as variables, functions, arrays and so on.
In above example, number and amount are identifiers. Ass previously mentioned identifier must be different than the keywords. That means, float is keyword hence I cannot write
Because float is a reserved keyword.
Rules for writing identifiers
- Identifiers may only include the following characters: letters (‘a’..’z’, ‘A’..’Z’), digits (‘0’..’9′) and underscores (‘_’). C is case sensitive, so seaside, SeaSide and SEASIDE are distinct identifiers.
- The first character must not be a digit.
- The identifier must not be one of C’s 32 keywords.
Difference between keyword and identifier
|It is predefined-word in C programming||It is user-defined word in C programming|
|These must be written in lowercase only ||These can be written in lowercase and uppercase |
|has meaning to compiler||must be meaningful to program and programmer|