TIntPtr is a pointer type to INTEGER.
DECLARE A, B : INTEGER
DECLARE P : TIntPtr
A ← 10
B ← 4
P ← ^A
P^ ← P^ − 3
P ← ^B
P^ ← P^ + A
What are the final values of A and B?
- P ← ^A makes P point to A, so P^ ← P^ − 3 changes A: 10 − 3 = 7.
- P ← ^B makes P point to B; A is not changed by this.
- P^ ← P^ + A changes B: 4 + 7 = 11.
Answer: A = 7 and B = 11.