Posts

Multidimensional Arrays

Image
 Hi, you are welcome to this blog........................... What is multidimensional array? Let's see about this. We can identify a table as a 2D array. this table has two rows and three columns. Mtr[  ][  ] is a matrix. table1 Take example as we have a matrix as mtr. Also mtr has 4 rows and 3 columns.(picture 1) picture 1 Above matrix, 1, 2,3 --> first row      4,5,8 --> second row 7,9,6 --> third row            12,11,17 --> fourth row 1,4,7,12 --> first column 2,5,9,11 --> second column 3,8,6,17 --> third column  We can initialize this matrix as mtr[4][3].  In first square bracket how many rows and second one how many columns. This is an initialization of a matrix. matrix is x. int x[ 2 ][ 3 ]={{ 1 , 2 , 3 }, { 3 , 4 , 5 }}; Also this method is correct. int x[ 2 ][ 3 ]={ 1 , 2 , 3 , 4 , 5 , 6 };  In short, how to access 2D array: int matrix[ 3 ][ 4 ]; // declare the matrix mat...