Every programming language has its own set of characters. The characters used in C are divided into 3 categories
- Digits
- Alphabets
- Special characters.
TABLE SHOWS DIFFERENT ALPHABETS , DIGITS , SPECIAL SYMBOLS USED IN C LANGUAGE:
C TOKENS:
|
|
|
|
|
|
|
|
C TOKENS:
The individual units C program are known as C tokens. We use 6 types of tokens in any C program
- Identifier
- Strings
- Constants
- Keywords
- Special symbols
- Operators
KEYWORDS AND IDENTIFIERS:
In C program every word is either a identifier or a keyword. There are 32 keywords used in C Language supported by ANSI. Keywords are the reserve words which have one or more fixed meanings and the meaning of all keywords in any circumstances cannot be changed that is why these are reserve words. All the keywords of C Language are written in Lowercase letter because In C Language uppercase and lowercase letters are significant that is different meanings. List of keywords are:
TABLE SHOWS DIFFERENT KEYWORDS USED IN C LANGUAGE:
In C program every word is either a identifier or a keyword. There are 32 keywords used in C Language supported by ANSI. Keywords are the reserve words which have one or more fixed meanings and the meaning of all keywords in any circumstances cannot be changed that is why these are reserve words. All the keywords of C Language are written in Lowercase letter because In C Language uppercase and lowercase letters are significant that is different meanings. List of keywords are:
TABLE SHOWS DIFFERENT KEYWORDS USED IN C LANGUAGE:
|
|
|
|
IDENTIFIERS:
Identifiers may be defined as variable name, array name , function name, class name etc.Basically identifiers are the sequence of alphabets and digits.
RULE FOR FORMING IDENTIFIER NAME:
- Keywords should not allow to be used as identifier.
- Uppercase and lowercase identifiers are different.
- The first character must be an alphabet or an underscore.
- Two successive underscores are not allowed.
- No special characters except underscore "_" are allowed.
- All succeeding characters must be either letters or digits.
EXAMPLES:
- int a2 VALID
- int _a23 VALID
- int a_257 VALID
- float abc VALID
- int a__2 INVALID
- int 2_b INVALID
- int char INVALID
- int name VALID
- float while INVALID
- float !a INVALID
0 Response to "Basic Concepts of C Language"
Post a Comment