C Programming - Arrays - Discussion

Discussion Forum : Arrays - Yes / No Questions (Q.No. 3)
3.
Is there any difference int the following declarations?
int fun(int arr[]);
int fun(int arr[2]);
Yes
No
Answer: Option
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.

Discussion:
14 comments Page 2 of 2.

Bhavesh said:   1 decade ago
The first statement signifies that any number of elements are possible in the array ?

Raj said:   9 years ago
1st one does not contain size of the array.

2nd one contain size of array.

Raj said:   1 decade ago
Thanks niyati nice explanation.

Rohit Singh said:   9 years ago
You are right @Ravindra Bagale.


Post your comments here:

Your comments will be displayed after verification.