1. Given the function prototype void funl (int &, double) is the following funct
ID: 3704826 • Letter: 1
Question
1. Given the function prototype void funl (int &, double) is the following function call valid or invalid? Why or why not? double x, y: fun1 (x, y) 2. Given the function prototype void funl (int &, double); is the following function call valid or invalid? Why or why not? double x, y: fun1 (static cast (x), 3); 3. Given the function prototype void funl (int &, double); is the following function call valid or invalid? Why or why not? int x, y: fun1 (x, y); 4. Given the function prototype void funl (int &, double); is the following function call valid or invalid? Why or why not? int x, y; double z; funl (x + y, z): 5. Given the function prototype double fun2 (int , double) is the following function call valid or invalid? Why or why not? double x, y: fun2 (x, fun2 (x, y) ) ;Explanation / Answer
Hi Dear,
Please find my answer.
Please let me know in case of any issue.
1.
Invalid, becasue fun1 functiona take first parameter as integer reference and
second parameter as double, but we are passing both as double
2.
Invalid, becasue fun1 functiona take first parameter as integer reference but
we are passing integere literal (constant)
3.
valid, becasue integers are also treated as double, so its valid
4. Invalid, becasue fun1 functiona take first parameter as integer reference but
we are passing integere literal (x + y is not an reference variable)
5. Invalid, becasue fun2 functiona take first parameter as integer but passing double
Please DONT forgot to rate my answer. We are working hard for you Guys!!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.