CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

While passing an array as an actual argument, the function call must have

A
the array name with empty brackets
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
the array name with its size
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
the array name alone
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
none of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C the array name alone

While passing an array as an actual argument, the function call must have the array name alone.

An array reference always "decays" to a pointer to the first element of the array. Therefore, it isn't possible to pass an array "by value". An array in a function call will be passed to the function as a pointer, which is analogous to passing the array by reference.

While passing arrays as arguments to the function, only the name of the array is passed. C program to pass an array containing age of person to a function. This function should find average age and display the average age in main function.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Rectification of Errors
ACCOUNTANCY
Watch in App
Join BYJU'S Learning Program
CrossIcon