Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. Input/Output statements
  5. Identifier

Identifier

An identifier refers to the name of an object. It can be a variable name, a label name, a function name, member of a structure, union or an enumeration

Rules for writing identifier

  • Identifier name in C can have letters, digits or underscores
  • The first character of an identifier name must be a letter (either uppercase or lowercase) or an underscore. The first character of an identifier cannot be a digit
  • No special character (except underscore), blank spaces and comma can be used in an identifier name
  • Keywords or reserved words cannot form a valid identifier name
  • The maximum number of characters allowed in an identifier name is compiler dependent, but the limit imposed by all the compilers provides enough flexibility to create meaningful identifier names

Example

student_name, Student_name, stud1,_student

Invalid Identifiers

1stud, Name&Rollno, student name, for

Views: 0

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments