Identifiers and Keywords in C Programming | C Programming Language

Identifiers in C

Identifiers refers to the name given to the entities such as variables, functions, structures etc. Identifiers must be unique. They are created to give unique name to the entity to identify it during the execution of the program.
For example:-
int money;
double account balance;
Here, money and account balance are identifiers.

Rules of writing identifiers

  1. First character must be an alphabet (or underscore)
  2. Identifier names must consists of only letters, digits and underscore.
  3. An identifier name should have less than 31 characters.
  4.  Any standard C language keyword cannot be used as a variable name.
  5. An identifier should not contain a space. 

Keywords in C-:

Key words are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are the part of the syntax and they cannot be used as an identifier. 
For example:-  int money;
Here, int is the keyword that indicates money is a variable of the type integer.

The following are the Keyword set of C language.

Auto, else, register, union, break, enum, return, case, extern, unsigned, short, void, char, float, signed volatile, const, for, size of, while, continue goto, static, default, if, struct, do, int, switch, double, long, typedef

Post a Comment