Possible Duplicate:
Sizeof an array in the C programming language?
I'm trying to write a function that return 1s if a value is in the array. Here's the code:
int inArrayInt(int iVal, int iArray[])
{
    int i;
    int arrayL = sizeof(*iArray) / sizeof(int);
    int flag = 0;
    for(i=0; i < arrayL; i++)
    {
        if(iVal == iArray[i])
        {
            flag = 1;
        }
    }
    return flag;
}
The problem is that arrayL = sizeof(*iArray) / sizeof(int); always evaluates to 1, even if array contains 20 elements. Why?
 
     
     
     
     
    