If your guess is 40, it is definitely not!!!
#define SIZE 10
void size(int arr[SIZE])
{
printf("size of array is:%d\n",sizeof(arr));
}
int main()
{
int arr[SIZE];
size(arr);
return 0;
}
Explanation:
The input to the function is not the entire array. Only the address of the first element of the array will be passed into the function.
No comments:
Post a Comment