I need some help counting the rows and columns of a two dimensional array. It seems like I can\'t count columns?
#include
int main() {
char res
// gets you the total size of the 2d array
printf("Arrays Total size: %ld\n",sizeof(result));
// gets you the cumulative size of row which is 5 columns * sizeof(int)
printf("1 row cumulative size: %ld\n",sizeof(result[0]));
// division of total array size with cumulative size of row gets you total number of rows
printf("total number of rows: %ld\n",sizeof(result)/sizeof(result[0]));
// and total number of columns you get by dividing cumulative row size with sizeof(char)
printf("total number of columns: %ld\n",sizeof(result[0])/sizeof(char));