Question: Lab Exercises Create a new project named lab 6 _ 1 . Read the steps for each portion of this lab. Diagram the memory as

Lab Exercises
Create a new project named lab6_1. Read the steps for each portion of this lab. Diagram the memory as outlined in the steps (don't need to turn this part in). Then, write the code to verify your written work.
Declare int variables x and y and int* pointer variables p and q. Set x to 2,y to 8,p to the address of x, and q to the address of y. Then print the following information:
The address of x(use the address operator) and the value of x.
For example, that output statement may look like:
cout &x=&x,x=x endl;
The value of p and the value of ?**p.
The address of y(use address operator) and the value of y.
The value of q and the value of ?**q.
The address of p(not its contents, don't dereference).
The address of q(not its contents, don't dereference).
How are the addresses of x,y,p, and q related? List them out and find the distances between each address. You can include these answers in your program as a block comment, or an output
 Lab Exercises Create a new project named lab6_1. Read the steps

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!