Question
int DIM(int array[]) {
return sizeof(array)/sizeof(int );
}
main(){
int arr[10];
printf(“The dimension of the array is %d”, DIM(arr));
}

Answers

1
Explanation:
Arrays cannot be passed to functions as arguments and only the pointers can be passed. So the argument is equivalent to int * array (this is one of the very few places where [] and * usage are equivalent). The return statement becomes, sizeof(int *)/ sizeof(int) that happens to be equal in this case.   Your Comment






Search
Can you Answer!!
  • Q The most populous state in India?
  • Q You are designing a GUI application with a window and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What’s the problem?
  • Q Select the answer from among the choices, which produces the most effective sentence, one that is clear and exact for the sentence marked in bold."Terrorist ransacks their homes looking for arms; they brutalize men and insult women."
  • Q The Tons is the largest tributary of which river?
  • Q Can my barber school hours transfer to cosmetology school hours?
  • Q What is hue and saturation?
  • Q Biochemistry job description? job profile of Biochemistry?
  • Q Do you have any customers using the software functionality today that we can talk to?
  • Q Explain the concept of compaction in cassandra.?
  • Q Change the Parts of Speech of the Practical (into Verb) as directed in the parentheses
  • Q What are the different types of interrupts in a microprocessor system, explain?