3. •it was renamed to C++ in 1983.
•It is pronounced "C-Plus-Plus.“( c was developed in
the early 1970)
• It is therefore possible to code C++ in a "C style" or
"object-oriented style."
•The c++ programming language was
developed by bjarne stroustrup, also at AT &
T Bell Labs.
4. C++ is an object –oriented programming
language. It is an extension of c with a major
addition of the class construct features of
simula67. The idea of c++comes from the
increment operator ++ of c language there
by suggesting that c++ is an augmented
(incremented) version of c.
What is C++? / Definitions
5.
6. INTRODUCTION OF ARRAY
Arrays are the collection of homogeneous elements such
that the elements are stored in consecutive memory
location or we can say that the “Array is a collection of
variables of the same type of data that are referred by a
common name, These elements are referenced
respectively by an index set consisting of ‘n’ consecutive
numbers.
An array stores a list of finite number (n) of
homogeneous data elements(i.e. Data elements of the
same type)the number(n) is called length or size or
range of an array. when upper bound and lower bound of
an array are given, its size is calculated follows-
Array size (length)=UB –LB+1
7. Array Declaration
Declaration is an important process for a variable so that
the compiler will know what kind o variable, containing
which type of value and of what size is required by the
user.
therefore, an array is also declared as other
variable.
Syntax of array declaration is as follows-
Int - N [a];
Type of data Name of Variable Size of length
8. TYPES OF ARRAYS
1-ONE-DIMENSIONAL ARRAYS 2-MULTI-DIMENSIONAL ARRAY
TWO-DIMENSIONAL ARRAYS Tree dimensional arrays
Comprised of
finite
homogeneous
elements.
Comprised of
elements, each
of which is
itself an array.
9. •Arrays can of following types:
1. One dimensional (1-D) arrays or Linear arrays
2. Multi dimensional arrays
(a) Two dimensional (2-D) arrays or Matrix arrays
(b) Three dimensional arrays
1. One dimensional (1-D) arrays or Linear arrays:
In it each element is represented by a single subscript.
The elements are stored in consecutive memory
locations.
• EXAMPLE- A [1], A [2], ….., A [N].
10. 2. Multi dimensional arrays:
(a) Two dimensional (2-D) arrays or Matrix arrays:
In it each element is represented by two subscripts. Thus a two
dimensional m x n array A has m rows and n columns and
contains m*n elements. It is also called matrix array because in
it the elements form a matrix.
EXAMPLE- A [2] [3] has 2 rows and 3 columns and 2*3 = 6
elements.
(b) Three dimensional arrays:
In it each element is represented by three subscripts. Thus a
three dimensional m x n x l array A contains m*n*l elements.
EXAMPLE- A [2] [3] [2] has 2*3*2 = 12 elements.
11. Advantages: OF ARRAY
1. It is used to represent multiple
data items of same type by using
only single name.
2. It can be used to implement
other data structures like linked
lists, stacks, queues, trees, graphs
etc.
3. 2D arrays are used to represent
matrices.