In this tutorial you would learn about keywords and identifiers in C language. Which is basic concept of C language syntax.
Keywords are predefined and reserved words for C language. Compiler knows the meaning of these words.
All keywords are written in lowercase.
Here is list of all keywords in C.
As mentioned earlier, all these keywords has some associated meaning with then which instructs the compiler what you want to do/convey to compiler.
Identifiers are name given to C constructs which are declared using C keywords.
Rules to write C identifiers
- It can contain only alphanumberic (a-z,A-Z,0-9) and underscore ( _ ) characters only
Below are some valid identifier names.
- It can't start with digit.
i.e. '9number' is invalid identifier
- Identifiers are case sensitives.
i.e. 'number' and 'Number' are two different identifiers
Here we have declared variable 'number' of type integer.
'int' is keyword here whereas 'number' is identifier.
Here we have declared variable 'value' of type long integer.
'long' is keyword here whereas 'value' is identifier.
Here we have declared variable 'ch10' of type character.
'char' is keyword here whereas 'ch10' is identifier.
We recommend you to take a quiz on C Keywords and Identifiers to test and improve your understanding.