O'Reilly logo

Object Oriented Programming with C++, Second Edition by Sunil Patekar, Mahesh Bhave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.10 ARRAYS

3.10.1 Introduction

Array is by far the most powerful data structure in any programming language. This is the reason why it is inbuilt in all the higher level languages, old as well as new. We may not find any useful program without using an array.

Array is designed to store many members of a given type in a sequence. These members of an array are referred as elements. Array has a name and an index. Index is enclosed in square brackets. Advantage of arrays is that you can access any array element randomly.

Array declaration

Array is declared as follows:

type <array_name> [ size ]

“type” is any built in or user-defined type except type reference. Every element of an array is of this type. Array_name is the name of an array. Technically, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required