C++ Multidimensional Arrays (2D and 3D Arrays) - Coding With Clicks

Поділитися
Вставка
  • Опубліковано 15 гру 2022
  • ‪@CodingWithClicks‬
    ------------------------------------Multi-Dimensional Arrays----------------------------------------
    We'll learn about multi-dimensional arrays in C++ in this video. Multidimensional Array means an array having more than one dimension. There are different types of multidimensional arrays like 2D, 3D, 4D and 5D Array. But most important and most commonly used multidimensional array is 2D array and after that 3D array. So we will learn 2D Arrays and 3D Arrays in this video. How to declare, access, and use 2D and 3D Arrays effectively in C++ program.
    ------------------------------------Two Dimensional Arrays----------------------------------------
    As an example: int x [ 2 ][ 4 ];
    x is a two dimensional array in this case and it can hold maximum 8 values.
    2D Array Initialization:
    int x[2][4] = {{1,2,3,4},{5,6,7,8}};
    Because this array contains two rows and four columns, we have two rows of elements with four elements each.
    ------------------------------------Three Dimensional Arrays----------------------------------------
    Three dimensional Array also work similarly. Three dimensional Array is actually a collection of 2D arrays.
    For example: int x [ 3 ][ 2 ][ 4 ];
    By simply multiplying the dimensions of the array, we can determine how many elements are there in total: 3*2*4 = 24
    Here x is a three dimensional array which contains 24 elements.
    2D Array Initialization:
    int x[3][2][4] = {
    {{1,2,3,4},{5,6,7,8}},
    {{9,10,11,12},{13,14,15,16}},
    {{17,18,19,20},{21,22,23,24}},
    };
    The first dimension has value 3 which is representing total no of 2D arrays, second dimension has value 2 which represents no of rows and third dimension has value 4 which represents no of columns.
    #C++MultidimensionalArray #2DArray #twodimensionalArray #3DArray #ThreeDimensionalArray #C++TutorialForBeginners #C++FullCourse #C++Programming #codingwithclicks

КОМЕНТАРІ • 4

  • @yasiriqbal8780
    @yasiriqbal8780 6 місяців тому

    Probably this is the first programming language teaching video about which i didn't notice when it ended...

  • @SAM-12314
    @SAM-12314 7 місяців тому

    perfect way of explaining

  • @animalslover6313
    @animalslover6313 6 місяців тому

    After listening to this video I thought this channel should have millions of subscribers but ....May your channel got worth !!!

  • @gymguy935
    @gymguy935 6 місяців тому

    Very underrated channel. May Allah bless you sis.