Table of Contents
show
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