Identifier
Identifier
- An identifier is a string of alphanumeric characters that begin with an alphabetic character or underscore character that are used to represent various programming elements such as variable, Functions, array, structure, unions and so on.
- An identifier is a user-defined word. Also remember identifiers must be unique. They are created to give a unique name to an entity to identify it during the execution of the program and the identifier name must be different from the keyword.
- Rules for naming identifiers.
- An identifier can have letters both uppercase and lowercase letters, digit, and underscores.
- The first letter of an identifier should be a letter or an underscore.
- You can not use the keyword as an identifier.
- Identifier names must be unique.
Example of identifier.
int sum;
float average;
function name
void sum_of_twonumber();
void _student();
int main()
{
int a=99
printf("%d",a);
}
- Above program has two identifiers.
- main as a function name (Method name)
- a as a variable