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...
icon
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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
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
Bartleby Expert
SEE SOLUTION
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY