website logo

Keywords and Identifiers in C programming Language

C program is a set of instruction/statements and we know that every language use some grammar to write statement. C programming language also use some elements(grammar) to construct statement or we can say that we write statements using some syntax or rule those elements includes keywords, identifiers, constants, variable, character set and data type.

Character set

Character set is a group of character that use to form words, numbers and expressions. Group of characters that use to form words, numbers and expressions are mainly use uppercase letters A - Z , lowercase letter a - z, digits 0 to 9 and some special characters. with the help of these we form element like constants, variables, operators, expressions etc. smallest individual unit we form with number, letter and special character is known as token.
C tokens keywords, constants, Strings, Operators

Keywords and Identifiers

In C language every word are mainly divided into two category keywords and identifiers. Keywords : those words are reserved in C language for specific purpose is known as keywords and we can not use those words as identifiers(variable name , constant, user defined types etc) . all keywords have fixed meaning and those meaning can not be changed. we must use those keywords as per specified purpose not for any other purpose like we can not use keywords as a variable name, constant name etc.
Some standard keywords are:

float gotoint
long registervoid
returnshort signed
switch typedefunion
unsigned volatile

Identifiers : Identifiers are names of any anything(not keywords) that we used in c program like variable name, functions name, array name, user defined type etc. we can use letter, numbers, underscore to build identifiers in c. we can use combination letter , digit in any order except that the first character must be letter.
some valid identifiers are
XY, z55, john, barak_obama

some invalid identifiers are
XY z, 55z, barak-obama

keywords and identifiers in c programming