Arrays : Array Introduction « Array « C Tutorial






An array is a data structure process multiple elements with the same data type.

Array elements are accessed using subscript.

The valid range of subscript is 0 to size -1.

#include <stdio.h>
main()
{
    int a[5];
    int i;
    for(i = 0;i<5;i++)
    {
       a[i]=i;
    }

    for(i = 0;i<5;i++)
    {
        printf("value in array %d\n",a[i]);
    }
}
value in array 0
      value in array 1
      value in array 2
      value in array 3
      value in array 4








7.1.Array Introduction
7.1.1.Arrays
7.1.2.Address of each element in an array
7.1.3.Addition of the elements of the list