I am trying to make a function that accepts a an array by reference and determines the amount of rows in the 2-d array.
Is there a way to do this? (I do know the columns)
Code:
void printer(int [][3]);
int main(void)
{
int array1[][3]={{ 5,9, 0},
{14,7,13},
{ 2,10,8}};
int array2[][3]={{ 5,9, 0},
{14,7,13},
{55,10,9}
{ 2,10,8}};
printer(array1);
printer(array2);
}
void printer(int ary[][3])
{
int rows = ////// some way to calculate 3 from first instance and 4 for second instance, I have tried sizeof(array)/sizeof(int) but it only calculates the size of the address of array(0Xff244da) */
}
Any help would greatly be appreciated!