include using std::cout; int function bint pl, int& p2, int* p3); int function a(int p1, int& p2, int p3); int main() ( int x, y. Zi x = 2; y = 3; z = 4; cout << "Call 1: " << function a(&x, y, z) << "\n"; cout << "Call 2: " << function by, x, &z) << "\n"; int function a(int pl, int& p2, int p3) int a = *p1; *p1=p2 p3; p2 = a + p3; p3 = 5; int b= *p1 + p2+p3; return b; int function_b(int pl, int& p2, int* p3) for (int i = p1; i < p2 10; i++) { *p3 = *p3 + 5; } return pl + p2 + *p3; Fill in a memory table that shows the final values for both function a and function b. Indicate the final values of each parameter, passed in variable(s), and the return value of the function. Provide a separate copy of this memory table for each function. Variable Name Return Value Address 0x01 Ox02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 ➖➖➖➖➖➖ Value
include using std::cout; int function bint pl, int& p2, int* p3); int function a(int p1, int& p2, int p3); int main() ( int x, y. Zi x = 2; y = 3; z = 4; cout << "Call 1: " << function a(&x, y, z) << "\n"; cout << "Call 2: " << function by, x, &z) << "\n"; int function a(int pl, int& p2, int p3) int a = *p1; *p1=p2 p3; p2 = a + p3; p3 = 5; int b= *p1 + p2+p3; return b; int function_b(int pl, int& p2, int* p3) for (int i = p1; i < p2 10; i++) { *p3 = *p3 + 5; } return pl + p2 + *p3; Fill in a memory table that shows the final values for both function a and function b. Indicate the final values of each parameter, passed in variable(s), and the return value of the function. Provide a separate copy of this memory table for each function. Variable Name Return Value Address 0x01 Ox02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 ➖➖➖➖➖➖ Value
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please solve and show steps, work, and information related to this problem. Thank you.
The following C++ code performs a set of various arithmetic operations using both pointers and references:
Fill in a memory table that shows the final values for both function a and function b.
Indicate the final values of each parameter, passed in variable(s), and the return value of the function. Provide a separate copy of this memory table for each function.
![#include <iostream>
using std::cout;
int function b int pl, int& p2, int* p3);
int function a(int pl, int& p2, int p3);
int main()
{
}
int
{
int x, y, Zi.
x = 2;
y = 3;
z = 4;
cout << "Call 1: " << function a(&x, y, z) << "\n";
cout << "Call 2: " << function_b(y, x, &z) << "\n";
function a(int* pl, int& p2, int p3)
int apli
*p1=p2 p3;
p2 = a + p3.;.
p3 = 5;
int b= *p1 + p2 + p3;
return b
b
int function_b(int pl, int& p2, int* p3)
for (int i = p1; i < p2 * 10; i++)
{
*p3 = *p3 + 5:
}
return pl + p2 + *p3;
Fill in a memory table that shows the final values for both function a and function b.
Indicate the final values of each parameter, passed in variable(s), and the return value of the function. Provide a separate copy of this memory table for each function.
Variable Name
Address
0x01
Ox02
0x03
0x04
0x05
0x06
0x07
Return Value
0x08
0x09
0x10
➖➖➖➖➖➖
Value](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1dbff557-c987-45fc-8dd6-6084416c9157%2Ff074135e-5985-4858-bd54-aba7301be420%2Fyicp5wq_processed.jpeg&w=3840&q=75)
Transcribed Image Text:#include <iostream>
using std::cout;
int function b int pl, int& p2, int* p3);
int function a(int pl, int& p2, int p3);
int main()
{
}
int
{
int x, y, Zi.
x = 2;
y = 3;
z = 4;
cout << "Call 1: " << function a(&x, y, z) << "\n";
cout << "Call 2: " << function_b(y, x, &z) << "\n";
function a(int* pl, int& p2, int p3)
int apli
*p1=p2 p3;
p2 = a + p3.;.
p3 = 5;
int b= *p1 + p2 + p3;
return b
b
int function_b(int pl, int& p2, int* p3)
for (int i = p1; i < p2 * 10; i++)
{
*p3 = *p3 + 5:
}
return pl + p2 + *p3;
Fill in a memory table that shows the final values for both function a and function b.
Indicate the final values of each parameter, passed in variable(s), and the return value of the function. Provide a separate copy of this memory table for each function.
Variable Name
Address
0x01
Ox02
0x03
0x04
0x05
0x06
0x07
Return Value
0x08
0x09
0x10
➖➖➖➖➖➖
Value
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
Can you provide a C++ code to include the a memory table for each function bot a and b and also int (main). Please show C++ code
Solution
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY