Chart I have to use to find the value of a
, p
, pp
, *p
, *pp
, and **pp
:
Variable Address Value
36 4
a 40 1
44 2
48 44
p 52 40
56 36
60 44
pp 64 52
68 56
I arrive at:
a = 1
p = 40
pp = 52
*p = 52
*pp = 64
Is **pp
as simple as taking the value located at *pp
(52)?? This is really my only idea, otherwise I am confused as to what to do.
*p
and*pp
don't make sense. They are de-referencingp
andpp
, but those are not pointers. Do you mean&p
and&pp
?gcc -Wall -Wextra -g
) then use a debugger (gdb
) to run your program step by step and display some data (e.g. pointer variable, and dereference them)*
works in the exactly opposite way from what you have guessed.