It's printing 0 but I expect 1. The size of first dimension in array is omitted because I want to pass multiple arrays entries in this same method how to get this for iteration
void printValues(char hotelData[][3][50], int n);
char hotelData [1][3][50] =
{
"unidadeid1Fk", "john fernandes", "executiveRoom"
};
int main( void )
{
printValues(hotelData, 0);
}
void printValues(char hotelData[][3][50], int n)
{
int arraySize = sizeof (hotelData) / sizeof (hotelData[0]);
printf("ArraySize: %i ", arraySize);
}
Output is
ArraySize: 0
And this code is returning this warning that I don't know what means and how to solve it:
teste.c: In function 'printValues': teste.c:29:32: warning: 'sizeof' on array function parameter 'hotelData' will return size of 'char
(*)[3][50]' [-Wsizeof-array-argument]
int arraySize = sizeof (hotelData) / sizeof (hotelData[0]);
^ teste.c:27:27: note: declared here
void printValues(char hotelData[][3][50], int n)