array typesan array is a collection of objects of


Array types

An array is a collection of objects of a one data type. The individual objects are accessed by their position in the array. This way of accessing is known as indexing or subscripting.

e.g.

                int arr[10];                           // Declares array of 10 integer objects

                int ival = arr[2];  // Assigns the value of third element in the array into ival

                arr[0] = ival;                        // Assigns the value of ival in to array

                              element arr[0]

An array definition having of a type specifier, an identifier, and a dimension.

Dimension specifies the number of elements contained in the array. An array must be given dimension size greater than or equal to 1. The dimension value must be a constant expression. i.e., the value should be available at compile time.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: array typesan array is a collection of objects of
Reference No:- TGS0309284

Expected delivery within 24 Hours