I'm trying to find the length of an array using the sizeof method, but I get this error
helpers.c:22:16: error: sizeof on array function parameter will return size of 'int *' instead of 'int []' [-Werror,-Wsizeof-array-argument] n = sizeof(values)/sizeof(int); ^ helpers.c:17:29: note: declared here
bool search(int value, int values[], int n)
Thanks,
What I have tried:
bool search(int value, int values[], int n)
{
n = sizeof(values)/sizeof(int);
}