Categories
How to determine the size of a two-dimensional array in C?
Let's say I have an array: How to determine the size of the first level? To output in this case 3. int arr[][2] = { {1,2}, {3,4}, {5,6} };
int arr[][2] = { {1,2}, {3,4}, {5,6} };
Answer the question
In order to leave comments, you need to log in
sizeof arr / sizeof arr[0]
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question