What Is Identifier In C Program Explain With Examples
Identifier:As per the name we can say to identify someone we need something, that's we called identifier. For Ex: if we create a variable int abc; now how can we identify what is abc, we can identify abc by ifront of him written int & int is a variable creator. so this is the work of identifier.
An identifier is a combination of alphanumeric characters, the first being a letter of the alphabet or an underline, and the remaining being any letter of the alphabet, any numeric digit, or the underline. In the case of some compilers, a dollar sign is permitted but not as the first character of an identifier.
How To Create Identifier/ Rules For Creating Identifier:
1. Identifier name must be a sequence of letter and digits, and must begin with a letter.
2. The underscore character (‘_’) is considered as letter.
3. Names shouldn't be a keyword (such as int , float, if ,break, for etc)
4. Both upper-case letter and lower-case letter characters are allowed. However, they're not
interchangeable.
5. No identifier may be keyword.
6. No special characters, such as semicolon,period,blank space, slash or comma are permitted
Examples of legal and illegal identifiers follow, first some legal identifiers:
Legal: int ab09, ias_2, ase, a, b, cd@.
illegal: _asa, 12as, @ewas;
Search Keyword:How to create identifier, Identifiers in c programming, how identifier work, definition of identifier in c


0 comments:
Post a Comment
Thanks For Your Comment. We Get Back To You As Soon As Possible.