Array in C++ Online Coaching in Ahmedabad

Page 1

Array in C++ Online Coaching in Ahmedabad Array is collection of more than one data at same location of same type. Syntax: data type name[size]; This will create memory of specified size-data. For example, an array containing 4 integer values of type int called rn could be represented as: int rn[4];

0

1

2

3

In array memory always start from 0. Initializing arrays By default, regular arrays of local scope (for example, those declared within a function) are left uninitialized. This means that none of its elements are set to any particular value; their contents are undetermined at the point the array is declared. But the elements in an array can be explicitly initialized to specific values when it is declared, by enclosing those initial values in braces {}. For example:


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Array in C++ Online Coaching in Ahmedabad by Rosario Riley - Issuu