I'm trying to make a function that returns the length of an array, but the function always returns 8
#include <iostream>
using namespace std;
int size(int arr[])
{
return sizeof(arr);
}
int main()
{
int v[] = {1, 2, 4};
cout << sizeof(v) << endl;
cout << size(v);
return 0;
}