Guess the output of the following C program!!!
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.
A Collection Of Weird and Interesting C Programs by Balaji
Saturday, July 7, 2007
Interesting C Program -5
Posted by
Balaji V
at
5:35 PM
Labels: INTERESTING C PROGRAMS
Subscribe to:
Post Comments (Atom)







0 comments:
Post a Comment