Thursday, January 12, 2012

Arrays


                                       ARRAYS

·        Array notation
  • Array declaration
  • Array initialization
  • Processing with an array
  • Functions and arrays
  • Multidimensional arrays
  • Character arrays

This chapter deals with the method of declaring the array, array notation, array initialization and processing with arrays. One dimensional, multidimensional arrays and character arrays are explained in detail and their use are illustrated with examples.

ARRAY NOTATION
An array is a collection of identical data object which are stored in consecutive memory locations under a common heading or a variable name. In other words, an array is a group or a table of values referred to by the same variable name. The individual values in an array are called elements. Array elements are also variables.
    Arrays are sets of values of the same type, which have a single name followed by an index. In C++, square brackets appear around the index right after the name, with the first element referred to by the number.
    Whenever an array name with an index appears in an expression, the C++ compiler assumes that element to be of an array type.

No comments:

Post a Comment