information about computer technology and about computer languages.

Thursday, 4 February 2021

Elements of C Language

 Element of C language


Identifier

  • Identifier is a name given to the constant, function , variable or label in the program.
  • Identifier name should be short and descriptive.
  • Identifier may consist of 31 characters.
  • Identifier is an important feature of all computer language. 
  • The first character must be must be an alphabet or underscore.
  • The reserved word cannot be used as identifier.

Types of identifiers

There are two types of identifier.

Standard Identifiers

Standard identifier is type of identifier which have special meaning in C source program is called standard identifier. Standard identifier name used for  standard library functions.
for example : Printf and Scanf . it is an input /output operations used in program C.

User-defined Identifiers

User-defined is a type of identifiers that is defined by the user or programmer to access memory location is called user-defined identifiers.
For example : a, b, marks and age are example of user-defined identifiers.

Keywords

Keywords are reserved words used in C language. Keywords has predefined meaning and special purpose to the compiler. Keywords are written in lowercase. The keyword is defined by the developer of the language, the user cannot changed or redefined it. There are different types of keywords. The total number of keywords is 32.

List of keywords

continue    double    register    signed    sizeof    typedef    unsigned
volatile      break      default     const      extern    return      static
while         union      switch      struct     float       auto         case
char           else         enum        for         goto       long         short
do              void        if               int         

No comments:

Post a Comment