These notes for CBSE Class 12 Informatics Practices introduce the fundamentals of C++. They cover the C++ character set, including letters, digits, special symbols, and white spaces. The concept of tokens, the smallest individual units in a program, is explained, along with different types of tokens: keywords (reserved words with special meanings), identifiers (names for variables, functions, etc.), and literals (data items that don't change value). The notes detail various kinds of literals: integer (decimal, octal, hexadecimal), character, floating, and string literals. Punctuators, also known as separators, like brackets, parentheses, braces, semicolons, and commas, are described with their functions. Finally, operators are introduced, categorized into unary, binary, and ternary operators based on the number of operands they require. These notes are ideal for quick revision of C++ basics for exams.
Last optimized 10 Aug 2026
| Letters | A-Z , a-z |
| Digits | 0-9 |
| Special Symbols Space | + - * / ^ ( ) [ ] { } = != <> . „ “ $ , ; : % ! & ? _ # <= >= @ |
| White Spaces | Blank spaces, horizontal tab, carriage return |
| Other Characters | Any of the 256 ASCII character |
Token:-The smallest individual unit in a program is known as token. Tokens used in C++ are:
Keywords are the certain reserved words that convey a special meaning to the compiler. These are reserve for special purpose and must not be used as identifier name.eg for , if, else , this , do, etc.
variables, functions, arrays, objects, classes, etc.. It may contain digits, letters and underscore, and must begin with a letter or underscore. C++ is case sensitive as it treats upper and lower case letters differently. The following are some valid identifiers: Pen time580 s2e2r3 _dos _HJI3_JK
The data items which never change their value throughout the program run. There are several
kinds of literals:
•Integer literals
• Character literals
•Floating literals
•String literals
Integer literals are whole numbers without any fractional part. An integer literal must have at least one digit and must not contain any decimal point. It may contain either + or - sign. A number with no sign is assumed as positive. C++ allows three types of integer literals: (i) Decimal Integer Literals :- An integer literal without leading 0 (zero) is called decimal integer literals e.g., 123, 786 , +97 , etc. (ii) Octal Integer Literals :- A sequence of octal digit starting with 0 (zero) is taken to be an octal integer literal ( zero followed by octal digits). e.g., 0345, 0123 , etc. (iii) Hexadecimal Integer Literals :- Hexadecimal Integer Literals starts with 0x or 0X followed by any hexa digits. e.g., 0x9A45, 0X1234, etc.
Any single character enclosed within single quotes is a character literal.
e.g ‘ A’ , ‘3’
Floating literals
Numbers which are having the fractional part are referred as floating literals or real literals.
It may be a positive or negative number. A number with no sign is assumed to be a positive
number.
e.g 2.0, 17.5, -0.00256
String Literals
It is a sequence of character surrounded by double quotes. e.g., “abc” , “23”.
PUNCTUATORS:
The following characters are used as punctuators which are also known as separators in
C++
[ ] { } ( ) , ; : * ……….. = #
Punctuator |
Name |
Function |
[ ] |
Brackets | These indicates single and multidimensional array subscripts |
( ) |
Parenthesis | These indicates single and multidimensional array subscripts |
{ } |
Braces | Indicate the start and end of compound statements. |
; |
Semicolon | This is a statement terminator. |
, |
Comma | It is used as a separator. |
: |
Colon | It indicates a labeled statement |
* |
Astrisk | It is used as a pointer declaration |
.. |
Ellipsis | These are used in the formal argument lists of function prototype to |
= |
Equal to | It is used as an assigning operator. |
# |
Pound singn... | This is used as preprocessor directives. |
An operator is a symbol or character or word which trigger some operation (computation)
on its operands.
(i) Unary operators :- Those which require only one operand to operate upon. e.g. unary - ,
unary + , ++ , - - ! .
(ii) Binary operators :- Binary operators require two operands to operate upon. e.g. +, *, /, -,
etc.
(iii) Ternary Operator :- Ternary operator require three operands to operate upon. Conditional
operator (? :) is a ternary operator in C++.
These notes cover the C++ character set, tokens (keywords, identifiers, literals), punctuators, and operators.
A token is the smallest individual unit in a C++ program, such as keywords, identifiers, literals, and operators.
C++ supports integer literals (decimal, octal, hexadecimal), character literals, floating literals, and string literals.
Keywords are reserved words with special meanings for the compiler, while identifiers are names given to program elements like variables and functions.
Punctuators, also known as separators, are characters like brackets, parentheses, braces, and semicolons used to organize program structure.
Operators are classified based on the number of operands they operate on: unary (one operand), binary (two operands), and ternary (three operands).
Yes, these notes are specifically designed for CBSE Class 12 Informatics Practices, covering introductory C++ concepts.
Copyright @ ncerthelp.com A free educational website for CBSE, ICSE and UP board.