ARRAY in C++. Why, when and how to use array

SanjaySahu763355 15 views 5 slides Sep 23, 2024
Slide 1
Slide 1 of 5
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5

About This Presentation

Get a basic understanding of array.


Slide Content

ARRAY in C++ Why, When and How to use array

What is an Array An array is a c ollection of elements with similar data type . Element are identified by an index or a key. Store values in contiguous fashion . EX. 4 6 3 5 8 8 9 Arr 1 2 3 4 5 6 index value

Declaring an Array Syntax dataType arrayName [size] ; Example :

Defining an Array dataType arrayName [ ] = { V, A, L, U, E, S} ;

Accessing Elements Array allows random element access with a integer index. Syntax arrayName [index] = value ;