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

In which of the following cases is it possible to obtain different results for call by reference and call by name parameter passing methods?

A
Passing a constant value as a parameter
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Passing the address of an array as a parameter
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Passing as an array as parameter
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Passing an array element as a parameter
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B Passing the address of an array as a parameter

Passing the address of an array as a parameter is possible to obtain different results for call by reference and call by name parameter passing methods.

Call by reference:-

When we pass the address of an array while calling a function then this is called function call by reference. When we pass an address as an argument, the function declaration should have a pointer as a parameter to receive the passed address.

Pass by name:-

This technique is used in programming language such as Algol. In this technique, symbolic “name” of a variable is passed, which allows it both to be accessed and update.


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