Two dimensional arrays and pointers

后端 未结 4 1212
春和景丽
春和景丽 2021-01-18 04:23

I have the following code snippet:

char board[3][3] = {
                     {\'1\',\'2\',\'3\'},
                     {\'4\',\'5\',\'6\'},
                          


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-18 04:39

    Though it's a 2D array, inside the memory it will be represented as linear array. so when you say, board[0][0] it still points to the first element in that linear array and hence the same memory address.

提交回复
热议问题