get length of multidimensional array with different length in c++?
Advertisements I have a multidimensional array and i’m trying to get the length of each column. But it’s returning 20 for all of them. int buttons[16][5] = {{0, 4, 1},{1, 0, 2, 5},{2, 1, 3, 6},{3, 2, 7},{4,0,5,8},{5,1,4,6,9},{6,2,5,7,10},{7,3,6,11},{8,4,9,12},{9,5,8,10,13},{10,6,9,11,14},{11,7,10,15},{12,8,13},{13,9,12,14},{14,10,13,15},{15,11,14}}; sizeof(buttons[0]); >Solution : You are declaring an C-style array where each element is an array of 5… Read More get length of multidimensional array with different length in c++?