Identifier in C Language

  Basic steps to learn any program-- 



Step 1   First we learn its characters, number and symbol.

Step 2   After that we learn identifier.(means word) 

Step 3   At last we learn Instruction (means sentence) then a Program was made.




Identifier


An identifier is a smallest unit of a program and it is a string of alphanumeric characters that begins with an alphabetic character or an underscore character that are used to represent various programming elements such as variables, functions, arrays, structures, unions and so on. Actually, an identifier is a user-defined word.

Identifier refers to name given to entities such as variables, functions, structures etc.
Identifier must be unique. They are created to give unique name to a entity to identify it during the execution of the program. For example: int age; and double money;

Here, age and money are identifiers.

Also remember, identifier names must be different from keywords. You cannot use int as an identifier because int is a keyword.

Rules for writing an identifier


1-A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores.

2-The first letter of an identifier should be either a letter or an underscore. However, it is discouraged to start an identifier name with an underscore.


 here is no rule on length of an identifier. However, the first 31 characters of identifiers are discriminated by the compiler. If this article is helpful to you then please like share.. 

Comments

Popular posts from this blog

Important Announcements(download all my book free)

O LEVEL- INTERNET TECHNOLOGY & WEB DESIGN

Call by Reference with Pointer in C Language part-4-a