Given pointer to an array as parameter to a function in C language, how to find its length?
int* mymap(int (*func)(int), int* Array) {
int size = sizeof(Array);
// giving 8 (which is size of int*),but I want length of the array which I gave is 5.
int* B = (int*) malloc(sizeof(int)*size);
printf("size %d\n", size);
for (int i = 0; i < size; ++i)
{
B[i] = func(Array[i]);
}
return B;
}