#include
#define COLS 4
int main()
{
int total;
int(*pt)[COLS];
pt = (int[2][COLS]) { {1, 2, 3, 4}, { 5,6,7,8 } };
total = sum(pt, 2);
printf("total=%d\n", total);
return 0;
}
int sum(int ar[][COLS], int rows)
{
int r, c;
int tot = 0;
for (r = 0; r < rows; r++)
for (c = 0; c < COLS; c++)
tot += ar[r][c];
}