Keyword & Identifiers In C Language

In this tutorial, we will learn about Keyword (Reserved Words) in C Language. Also we will learn about identifiers, their naming rules as well.

Any C Language programs is made by grouping of various Keywords and Identifiers. Keywords & Identifiers are the building block of any C program. C language has a list of words that are predefined. These words are known are keywords. An Identifier is user-defined, which means we can specify different-different identifiers while writing our program.

Keywords in C Language:

Every programming language maintains a list of reserved words, which have a special purpose and can't be used for any other purpose. These reserved words are known as keywords. Each keyword is used for some specific purpose, which is already defined by language. They can't be used to surf any other purpose. Keywords are part of the syntax and cannot be used as an identifier. In C Language, keywords are also a part of token.

C Language Keywords List

Identifiers in C Language:

In C language, identifiers are user defined friendly names given to variables, functions, constants or any other user-defined data types, to identify them easily. While defining a variable or any other entity, we need to provide a unique name to them, which can be used later in program to refer them.

There are some rules, which we need to follow While defining an identifier.

  1. An identifier can only have alphabates (a-z, A-Z), numeric characters (0-9) and underscore (_).
  2. The first letter of an identifier should be either a letter (a-z, A-Z) or underscore (_). So a valid identifier can't start with a numeric character.
  3. A keyword cannot be used as an Identifier.
  4. No special characters like semicolon, period, whitespaces, slash, or comma are permitted to be used as a identifier character.
  5. There is not any thumb rule about the length of a identifier. However some C Compilers can create an issue if the identifier length is greater then 31 characters.
  6. As a good practice, we should always provide meaningful and short names to identifiers.