a. Suppose that the caller has variables int mylnt and float myFloat whose values are 20 and 4.8, respectively. What are the values of mylnt and myEloat after return from the following function call? Demo(mylnt, muEloat); mvlnt: mvEloat: b. Also, describe what happens in MEMORY when the Demo function is called. Think about the by reference and by value parameters.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 29SA
icon
Related questions
Question
1. Consider the function definition:
void Demo (int intVal, float& floatVal
{
intVal = intVal * 2;
floatVal = float(intVal) + 3.5;
}
a. Suppose that the caller has variables int mylnt and float myEloat whose values
are 20 and 4.8, respectively. What are the values of mylnt and myEloat after
return from the following function call?
Demo(mylnt, myEloat);
mulnt:
mvEloat:
b. Also, describe what happens in MEMORY when the Demo function is called.
Think about the by reference and by value parameters.
Transcribed Image Text:1. Consider the function definition: void Demo (int intVal, float& floatVal { intVal = intVal * 2; floatVal = float(intVal) + 3.5; } a. Suppose that the caller has variables int mylnt and float myEloat whose values are 20 and 4.8, respectively. What are the values of mylnt and myEloat after return from the following function call? Demo(mylnt, myEloat); mulnt: mvEloat: b. Also, describe what happens in MEMORY when the Demo function is called. Think about the by reference and by value parameters.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr