#include <iostream>
int main() {
int matrix[][4] = { {2, 0, 5, 0},
{0, 4, 0, 0},
{0, 8, 0, 9} };
int rows = sizeof matrix / sizeof matrix[0];
int cols = sizeof matrix[0] / sizeof(int);
std::cout << "rows: " << rows << "\n";
std::cout << "cols: " << cols << "\n";
std::cout << "total cells: " << rows * cols << "\n";
}
/*
run:
rows: 3
cols: 4
total cells: 12
*/