Identifiers in C

Identifiers in C

Identifier is used to name various elements of program such as variables, constants, functions, arrays, functions etc. An identifier is a word consisting of sequence of Letters, Digits or _(underscore).

Rules to Name identifiers are

1. The variables must always begin with a letter or underscore as the first character.

2. The following letters can be any number of letters, digits or underscore.

3. Maximum length of any identifier is 31 characters for external names or 63 characters for local names.

4. Identifiers are case sensitive. Ex. Rate and RaTe are two different identifiers.

5. The variable name should not be a keyword. 

6. No special symbols are allowed except underscore.


Valid identifiers: 

  • Sum
  • roll_no
  • _name
  • sum_of_digits
  • avg_of_3_nums

Invalid Identifiers and reason for invalid: 

  • $roll_no - Name doesn‟t begin with either letter or underscore
  • for - keyword is used as name
  • sum,1 - special symbol comma is not allowed
  • 3_factorial - name begins with digit as first letter 

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2024 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz