Identifiers

What is identifier ?

      In C language identifiers are the names given to variables, constants, functions, and user-defined data. An identifier or name is a sequence of characters invented by the programmer to identify or name a specific object.

Rules for identifiers:-

  1. The first character must be an alphabet or underscore.
  2. All characters must be alphabetic characters, digit or underscores.
  3. Only the first 31 characters are significant.
  4. You can not use a keyword.
  5. Must not contain white space.
  6. Identifiers names must be unique.  

Some examples:-

people_number
monthly_pay
tool_4
box_4_weight
maths_2_sum 

When we declare a variable or any function in C language program, to use it we must provide a name to it, which identified it throughout the program.
example:-

           int sum_1 = "que1" ;
Here, sum_1 is name or identifiers for the variable which store the value "que1" in it. and int is a key word.
  

Comments

Popular posts from this blog

Getting input in C

Unary Operator