C++ Array Create Multidimensional Array

Description

C++ Array Create Multidimensional Array

#include <iostream>
#include <cstdlib>

using namespace std;

int myArray[10][20];

int main(int argc, char *argv[])
{
    int x,y;//from   w w  w .ja v a 2 s .c om
    for (x = 0; x < 10; x++) {
        for (y = 0; y < 20; y++ ) {
            myArray[x][y] = x * y;
        }
    }
    cout << myArray[9][13] << endl;
    cout << sizeof(myArray) / sizeof(int) << endl;
    return 0;
}



PreviousNext

Related