Page t027, go to NEXT, PREVIOUS, INDEX

Arrays


A collection of elements of same type

      float x[100];

Initializing array elements

      float x[3] = {1.1, 2.2, 3.3};
      float y[] = {1.1, 2.2, 3.3, 4.4};

Multi-dimensional arrays

      float m[4][4];
      int m2[2][3] = { {1, 2, 3},
                       {4, 5, 6} };

C Course, 21-jan-1997, Peter Klok, pfk@hef.kun.nl