Which of the following can never be sent by call-by-value?a.Variableb.Arrayc.Structuresd.Both Array and Structures
Question
Which of the following can never be sent by call-by-value?
- a. Variable
- b. Array
- c. Structures
- d. Both Array and Structures
Solution
The correct answer is d. Both Array and Structures.
In call-by-value, the function is called by directly passing the value of the variable as the argument. Changing the argument inside the function doesn’t affect the variable passed from outside the function. In languages like C and C++, we cannot pass the whole array as an argument to a function. However, we can pass the array by reference or by using a pointer. Similarly, structures also cannot be passed value to a function, but they can be passed as a reference or as a pointer. Therefore, both arrays and structures cannot be sent by call-by-value.
Similar Questions
Which of the following cannot be a structure member?Question 19Select one:Another structureFunctionArrayNone of the mentioned
Which of the following cannot be a structure member?*1 pointA. FunctionB. ArrayC. StructureD. None of the above
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
The default parameter passing mechanism isQuestion 3Answera.Call by value resultb.None of thesec.Call by valuesd.Call by reference
The default parameter passing mechanism isa.Call by valueb.Call by referencec.Call by value resultd.None of these.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.