An ARRAY is a accumulating of similar elements. These agnate elements could be all ints, or all floats, or all chars, etc. Usually, the arrangement of characters is alleged a 'string', admitting an arrangement of ints or floats is alleged basically an array. Keep in apperception that all elements of any accustomed arrangement accept to be of the aforementioned type. i.e. they cannot accept an arrangement of ten numbers, of which 5 are ints & 5 are floats.For example, we want to align the allotment marks acquired by 100 acceptance in ascendance order. In such a case they accept options to abundance these marks in memory:

  1. Construct 100 variables to abundance allotment marks acquired by 100 altered students, i.e. anniversary capricious absolute student's marks.
  2. Construct capricious (called arrangement or array) able to autumn or captivation all the hundred values.

Obviously, the additional another is better.This is wahat we call array.

ARRAY  INITIALISATION:
Arrays can be initialised as followed:

int a[6] = { 2, 4, 12, 5, 45, 5 } ;
 int b[ ] = { 2, 4, 12, 5, 45, 5 } ;
float c[ ] = { 12.3, 34.2 -23.4, -11.3 } ;



0 comments to "ARRAYS IN C LANGUAGE"

Post a Comment

Powered by Blogger.