What is the type of a pointer to a 2D array?
问题 I know that the following is not correct: int arr[2][3] = {}; //some array initialization here int** ptr; ptr = arr; But I am quite surprised that the following lines actually work int arr[2][3] = {}; //some array initialization here auto ptr = arr; int another_arr[2][3] = {}; //some array initialization here ptr = another_arr; Can anyone possibly explain what is the type assigned to ptr in the second block of code, and what happened underneath? 回答1: Well, arrays decay to pointers when used