C++
> C++ is a object oriented programming language/system.
> C++ was developed by "Bjarne stroustrup" at "AT & T Bell lab (early 1993).
> It is taken from "C language" & "Simula 67.
> Its early name was "c with class".
> The name C++ was coined by "Risk Mascitti" (early 1983).
Character set
Character set means which character is used in writing programming in C++.
EX:-
Letter (A-Z):- Upper case (a-z):- Lower case Digits:- (0-9)
Special symbol:- #, *,(), {}, <>, +, =, etc
White Space:- \a, \t, \n etc.
ASCII = American standard code for information Interchange.
Tokens
The smallest individual unit in programs referred as tokens.
Or
The smallest unit can be identified by the programming language. The basic types of tokens:-
i. Keyword
ii. Identifiers
iii. Literals/ Data type/ constant.
iv. Punctuators/ seperators/ special symbol.
v. Operator.
Keyword
keyword are the word having find meaning which are already explained to compiler of C++.
> It is reserved for instruction only.
> All keywords are written in lower case letter.
Some examples of keywords:-
Int, float/, void, char, double, long, if, else, switch, case, break, loop, do, while, continue, etc.
Identifier
A name of variables, array, object and class etc, created by programs i.e. user.
> It consists of letters, digits and underscore.
> It is case sensitive means upper case letter and lower case letters.
> The first character must be letter or underscore. The underscore (-) counts as a letter.
> We cannot use keywords as identifier.
Variable
> It is a name of memory location.
> It is used to store the data.
> Its value can be changed and it can be reused many times.
Data type
Data type is a way to identify type of data and associated operation which can perform on the
data.
Or
Data type is used to declare/defined a variable it specified the data store format of the variable. The
various category of Data type:-
1. Fundamental /Atomic /Primary (built in) data type.
• Integer
• Char
• Float
• Double
Void
2. derived data type:-
• Array.
• Function.
• Pointer.
• Structure.
• Union.
• String.
Operators
An operator is a symbol that tells the computer to perform certain mathematic, logical and
manipulation.
There are two basic types of operator:-
i. Unary operator.
ii. Binary operator
1 unary operator:-
Unary operators are those operator that require one operand to operate upon.
> Increment (++) / decrement (--) operator
Increment operator
;---------------1;
Prefix increment ++a postfix increment a++
First increase the value first assign then increase
the value by 1.
by 1 then assign.
a=4-0-11
a=4O11
b=a++
b=++a
b= 10
b= 11
a= 11
a= 11
I
Decrement operator
I
Prefix decrement
first decrease the value
post decrement
by 1 then assign. a=W9
first assign value then
b= - -a
Decrease the value by 1
b= 9
a= 4-0-9
a= 9
b=a--
b= 10
a= 9