Jul 172012
 

The function myfunc below is suppposed to print the size of array passed to it as parameter(arr). What do you think is the problem (if any)

    void myfunc(int arr[], int n)
    {
        printf("Size of Array : %d", sizeof(arr));
    }
    int main()
    {
        int a[5] = {1, 2, 3, 4, 5};
        myfunc(a, 5);
    }

Continue reading »