// elementary multidimensional array usage // Mikhail Nesterenko // 4/12/2013 #include using std::cout; using std::endl; int main (){ const int length=5, width=2; int a[length][width]; // declares an integer array of 5 rows and 2 columns // initializes the arry for(int i=0; i < length; ++i) for(int j=0; j < width; ++j) a[i][j] = i*width+j; // outputs each array element's value for (int i=0; i < length; ++i) for (int j=0; j < width; ++j) cout << "a[" << i << "][" << j << "] = " << a[i][j]<< endl; }