Q:

how to determine length of the array using its pointer? 

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;
}

A:

You can't do that.  sizeof works for array the way you expect it to be - returning the size of the array.  Even if you passed array which will be converted to pointer to first element to it (Known as array decay) so basically you are not using sizeof over an array - rather over an decayed pointer to it.  As a result now when you use it with sizeof operator it gives you sizeof pointer not size of array.  Solution is to pass the length as argument to the function. 
int array[] = {1, 2, 3};
size_t size = sizeof array / sizeof array[0];

..
f(array, size);

