C Character Set and Keywords
The characters can be used to form words, numbers and expressions depend upon the computer on which the program is run. However, a subset of characters is available that can be used on most personal, micro, mini and mainframe computers. The character in C is grouped into the following categories.
- Letters
- Digits
- Special CHaracters
- White Spaces
The entire character set is given in Table 2.1.
The compiler ignores white unless they are a part of a string constant. White spaces may be used to separate words, but are prohibited the character of keywords and identifiers. #allaboutprogramming62
Table 2.1 C Character Set |
Trigraph Characters
Many non-English keyboards do not support all the characters mentioned in Table 2.1. ANSI C introduces the concept of "trigraph" sequence to provide a way to enter certain characters that are not available on some keyboards. Each trigraph sequence consists of three characters (two question marks followed by another character) as shown in Table 2.2.
Download Turbo C++ Program Compiler
Download Code:: Block All Program Compiler
Download Turbo C++ Program Compiler
Download Code:: Block All Program Compiler
For example, if a keyword does not support square brackets, we can still use them in a program using the trigraphs ?? (and??).
Table 2.2 ANSI C Trigraph Sequence |
C TOKENS
In a passage of text, individuals words and punctuations marks are called tokens. Similarly, in a C programs, the smallest individuals units are known as C tokens. C has six types of tokens as shown in Fig. 2.1.C programs are written using three tokens and the syntax of the language.
Download Let us C eBook pdf - By Yashwant Kanetkar
Program Compile on Android Mobile
Download Let us C eBook pdf - By Yashwant Kanetkar
Program Compile on Android Mobile
Fig 2.1 C Tokens and Examples |
KEYWORDS AND IDENTIFIERS
Every C word is classified as either a keyword or an identifier. All keywords have fixed meanings and these meanings cannot be changed. Keywords serve as basic building blocks for program statements. The list of all keywords of ANSI C is listed in Table 2.3. All keywords must be written in lowercase. Some compilers may use additional keywords that must be identified from the C manual.
Identifiers refer to the names of variables, functions, and arrays. These are user-defined names and consist of a sequence of letters and digits, with a letter as a first character. Both uppercase and lowercase letters are permitted, although lowercase letters are commonly used as a link between two words in long identifiers.
Rules for Identifiers
- The first character must be an alphabet (or underscore).
- Must consist of only letters, digits or underscore.
- Only the first 31 characters are significant.
- Cannot use a keyword.
- Must not contain white spaces.
Note:-
C99 adds some more keywords. See the Appendix "C99 Features".
ReplyDeleteHow to Download PlayerUnknown's Battlegrounds for PC
Download PUBG PC
Download Free KineMaster Pro Mod APK 2021 [Fully Unlocked]
ReplyDeleteDownload Now
Download Free Windows 11 All In One 32/64 Bit ISO Oct-2021
ReplyDeleteDownload Now