C Identifiers ?
It is a collection of alphabets, special characters underscore which are represent or use to write various programming elements. Such as : variable, function, array, structure, union, labels are known as C identifier.
Whatever we use to write C program is known as identifier. Identifier name must differ in spelling as case from any keyword. We cannot use keywords as identifier.
#include<stdio.h>
int main()
{
int a=5;
printf(“%d”, a);
}
Types of Identifiers:-
- Internal Identifiers:-Internal variable can be local variable, if the identifier is not use in the external linkage, then it is known as an internal Identifier.
- External Identifiers:-If the identifier is used in the external linkage then it is known as an external identifier, it may be function name or global variable.
Reasons for invalid identifiers:-
- It must begin with alphabets or _.
- It should not be a keyword up to 31 character long.
- Only alphabets, numbers, _ (underscore) can be used.
- No other punctuation and special symbols are allowed.
C invalid identifiers
2total(it starts with number.)
int (int is a keywords.)
m-n (special character is not allowed.)
Difference between Keywords and identifiers:-
Keywords | Identifiers |
---|---|
Keywords have pre-defined meaning in a language. They are used for specific purpose. | Identifiers do not have pre-defined meaning in a language. |
Keywords have pre-defined meaning in a language. They are used for specific purpose. | Identifiers do not have pre-defined meaning in a language. |
Keywords have pre-defined meaning in a language. They are used for specific purpose. | Identifiers do not have pre-defined meaning in a language. |
Copyright © 2022 Shineskill Software Pvt. Ltd., All rights reserved.