Professional Documents
Culture Documents
ARRAYS
PREPARED BY MR. JOHN PATRICK S. PAULINO
OBJECTIVES
01 02 03
Understand the use Identify the types Develop simple
of arrays in C++ of arrays. programs using
programming. arrays.
WHAT IS AN ARRAY?
Fixed Size
DISADVANTAGE
OF ARRAYS
TYPES OF ARRAYS
array_name [index];
ONE-DIMENSIONAL ARRAY
Example: int score[5];
Graphical Representation:
5 10 15 20 25
Example:
data_type array_ame[row_size][column_size];
array_name[row_index][column_index];
TWO-DIMENSIONAL ARRAY
Graphical Representation:
Column
0 1 2
0 10 15 20
Row 1 25 30 35
2 40 45 50
TWO-DIMENSIONAL ARRAY
int score[3][3] = {
{10.15.20},
{25,30,35},
{40,45,50}
};
or