[A].
[B].
Answer: Option B
Explanation:
No, both the statements are same. It is the prototype for the function fun() that accepts one integer array as an parameter and returns an integer value.
[B].
Answer: Option B
Explanation:
No, both the statements are same. It is the prototype for the function fun() that accepts one integer array as an parameter and returns an integer value.
[B].
[C].
[D].
Answer: Option B
Explanation:
No answer description available for this question.
[B].
[C].
[D].
Answer: Option B
Explanation:
No answer description available for this question.
[B].
[C].
[D].
Answer: Option C
Explanation:
The statement ‘C’ is correct. When we pass an array as a funtion argument, the base address of the array will be passed.
[B].
[C].
[D].
Answer: Option D
Explanation:
No answer description available for this question.
[B].
Answer: Option A
Explanation:
Yes, It is possible to allocate a block of memory (of arbitrary size) at run-time, using the standard library’s malloc function, and treat it as an array.
[B].
[C].
[D].
Answer: Option C
Explanation:
The statement int arr[size]; produces an error, because we cannot initialize the size of array dynamically. Constant expression is required here.
Example: int arr[10];
One more point is there, that is, usually declaration is not allowed after calling any function in a current block of code. In the given program the declaration int arr[10]; is placed after a function call scanf().
[B].
Answer: Option B
Explanation:
Both mean two different things. arr gives the address of the first int, whereas the &arr gives the address of array of ints.
[B].
[C].
[D].
Answer: Option D
Explanation:
No answer description available for this question.
[B].
Answer: Option B
Explanation:
No, Mentioning the array name in C or C++ gives the base address in all contexts except one.
Syntactically, the compiler treats the array name as a pointer to the first element. You can reference elements using array syntax, a[n], or using pointer syntax, *(a+n), and you can even mix the usages within an expression.
When you pass an array name as a function argument, you are passing the “value of the pointer”, which means that you are implicitly passing the array by reference, even though all parameters in functions are “call by value”.