Header Ads Widget

Identifiers

What are identifiers in C language?

  Identifiers are user defined words and are used to give names to entities like variables, arrays, function, structures etc. There are two types of identifiers--

 1. External identifiers
 2. Internal  identifiers

External Identifiers

An external identifier will be  involved in an  external link process. These identifiers, called external names, include function names,global variable names that are shared between source files.

Internal Identifiers :

Internal identifiers include preprocessor  macro names and all other names that do not have external linkage.

Rules for constructing identifiers :

  • The name should consist of only alphabets, digits and underscore sign( _ ) .
  • First character should be an alphabet or underscore.
  • The name should not be a keyword.
  • Upper case and lower case letters considered different.
  • In C identifiers may be of any length. However, not all characters  will necessarily be significant. In C89 at least first 6 characters of external identifiers and at least the first 31 characters of an internal identifiers will be significant. In C99, an external identifier  has at lest 31 significant characters and an internal identifier has at least 63 significant characters.

Valid Identifiers :

  rate,  marks, Marks, MARKS,  _date, Sch_name, rect1

Invalid Identifiers :

 2nd_class, Area 1, doc-no

Post a Comment

0 Comments