Question: 5C Pointers Part A: Fill in blanks 1. Suppose the allocated addresses for variable x, y, and pt are as follows after declaration: x: 300
5C Pointers
Part A:
Fill in blanks
1. Suppose the allocated addresses for variable x, y, and pt are as follows after declaration:
x: 300
y: 296
pt: 292 and we are executing the following code sequence. Write down the values of x, y, and pt at each step. You may verify your answer in C (address will be different but they should be consistent).
| x | y | pt | why? | |
| int x =1; y =2; int *pt; | ||||
| pt = &x; | ||||
| y = *pt; | ||||
| x = pt; | ||||
| *pt = 5 | ||||
| pt = &y; | ||||
| *pt = x * x; |
submit the following two items from the rest:
- C program, and
- A screenshot showing the output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
