📖 Samacheer Kalvi · 11th TN - English Medium · Computer Science · Page 121question

Unit III · Part 2

Chapter 3: 4 · Computer Science

| ? . , : ‘ “ ; White space Blank space, Horizontal tab ( → ), Carriage return ( ) , Newline, Form feed Other characters C++ can process any of the ASCII characters as data. .

Lexical Units (Tokens): C++ program statements are constructed by many different small elements such as commands, variables, constants and many more symbols called as operators and punctuators. These individual elements are collectively called as Lexical units or Lexical elements or Tokens . C++ has the following tokens: • Keywords • Identifiers • Literals • Operators • Punctuators TOKEN: The smallest individual unit in a program is known as a Token or a Lexical unit . .

Keywords Keywords are the reserved words which convey specific meaning to the C++ compiler. They are the essential elements to construct C++ programs. Most of the keywords are common to C, C++ and Java. C++ is a case sensitive programming language so, all the keywords must be in lowercase.

Table . C++ Keywords asm auto break case catch char class const continue default delete do double else enum extern float for friend goto if inline int long new operator private protected public register return short signed sizeof static struct switch template this throw try typedef union unsigned virtual void volatile while • With revisions and additions, the recent list of keywords also includes: using, namespace, bal, , , , true, false • Identifiers containing a double underscore are reserved for use by C++ implementations and standard libraries and should be avoided by users. . .

Identifiers Identifiers are the user-defined names given to different parts of the C++ program viz. variables, functions, arrays, classes etc., These are the fundamental building blocks of a program. Every language has specific rules for naming the identifiers. Rules for naming an identifier: • The first character of an identifier must be an alphabet or an underscore (_).

• Only alphabets, digits and underscore are permitted. Other special characters are not allowed as part of an identifier. • C++ is case sensitive as it treats upper and lower-case characters differently. • Reserved

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →