#include <stdio.h>
int main(void)
{
int matrix[3][2] = {{1, 2},
{3, 4},
{5, 6}};
size_t rows = sizeof matrix/sizeof matrix[0];
size_t cols = (sizeof matrix/sizeof matrix[0][0])/rows;
printf("rows = %lu\n", rows); // also try %zu for size_t
printf("cols = %lu\n", cols); // also try %zu for size_t
return 0;
}
/*
run:
rows = 3
cols = 2
*/