the size of two dimensional array in C

but how to get the sizeof array for the last 45 rows, for example a[55][0] to a[99][99]?

can we do something like sizeof(&a[55])?

网友答案:

sizeof of an array is guaranteed to be equal to the sizeof of a single element multiplied by the number of elements. So, if you want to know how much memory is occupied by a specific number of rows, just calculate the number of elements and multiply by element size. 45 rows would require

45 * LINE * sizeof a[0][0]

Or, alternatively

45 * sizeof a[0]

It doesn't really matter whether these are last 45 rows. All rows are the same.