Table of Contents

    Multidimensional Array in C++

    Multidimensional Array in C++

    Definition

    A multidimensional array in C++ is an array that has more than one index, commonly used to store data in row and column form (like tables or matrices).

    The most common multidimensional array is a 2D array.

    General Syntax of a 2D Array

    data_type array_name[rows][columns];

    Example

    int matrix[3][4];

    Accessing Elements

    Elements are accessed using row index and column index:

    array_name[row_index][column_index]

    Example:

    matrix[1][2];