Identifiers are the names used to represent variable , constant , types , functions and label in the program. Identifier is an important feature of all computer languages. A good identifier name should be descriptive but short.
An identifier may consist of 31 characters. If there is 32 characters is used as identifier than first 31 will be used and other will be ignored by C compiler.
An identifier may consist of 31 characters. If there is 32 characters is used as identifier than first 31 will be used and other will be ignored by C compiler.
Rules for identifier ::
- The first character must be an alphabet and underscore( _ ).
- It must consist of only alphabetic characters, digits or underscore ( _ ).
- The keywords can not be used as identifier name.
- Standard Identifiers
- User-defined Identifiers
- Standard Identifier
Example ::
printf and scanf are the examples of standard identifiers.
- User-defined Identifiers
Example ::
Some example for User-Identifiers are a, marks, age, salary etc. (Any but must follow the rules).
Variables is a named memory location or memory cell. It is used to store program's input data and its computational results during execution. The value of the variable can be change. But the name of the variable can not be changed. The variables are created in RAM which is a temporary memory.
It consist of ::
- Name of the variable (It refer an identifier that represent a memory location)
- Address of variable (It refer to the memory location of the variable)
- Contents of variable (It refer to the value stored in memory location referred by variable)
No comments:
Post a Comment