02 Fundamental Objects
02 Fundamental Objects
Introduction
A programming language is designed to help process certain kinds of
data consisting of numbers, characters and strings and to provide
useful output known as information. The task of processing of data is
accomplished by executing a sequence of precise instructions called
a program. These instructions are formed using certain symbols and
words according to some rigid rules known as syntax rules or
grammar. Every program instruction must confirm precisely to the
syntax rules of the language.
Character set
The characters in C++ are grouped into the following categories:
1. Letters (A-Z, a-z)
2. Digits (0 – 9)
3. Special character (, . ; & * < > ] [ # )
4. White spaces (Blank space, Horizontal tab, Carriage return, NL)
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 a basic building blocks for programming
statements.
The following are reserved words in C++ and may not be otherwise
used.
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
Rules for identifiers
2. First character must be an alphabet (or underscore)
3. Must consist of only letters, digits or underscore
4. Only first 31 characters are significant
5. Cannot use a keyword
6. Must not contain white space
Constants
Constants in C++ refer to fixed values that do not change during the
change during the execution of a program.
CONSTANTS
STRING
REAL
CONSTANTS
CONSTANTS
Integral Types
Integer character
Signed Unsigned char
int unsigned int signed char
short int unsigned short int unsigned char
long int unsigned long int