Is there a difference between two functions in c?
There is no difference. The compiler will be interpreted as int *arr , since arrays are converted to a pointer to their first element when using a function as a parameter.
what will be the size of the first array in f1 function?
Strictly speaking, there is no array. Its only pointer to int . If you use sizeof(arr) , you get a value equal to sizeof(int *) .
The size of the array in the parameters is necessary when the type of the parameter is a pointer to the array. in this case, you need to specify the size of the array, since each size points to a pointer to a different type.
void f3(int (*arr)[10]);
source share