A pointer holds the memory address of a value rather than a copy of it. Two operators do the work:
&xtakes the address ofx.*pdereferences the pointerp— reading or writing the value it points at.
hp := 100
p := &hp // p points at hp
*p = 80 // changes hp through the pointer
fmt.Println(hp) // 80
Pointers are how a function changes a caller’s variable instead of a copy — exactly what pointer receivers did in the last lesson.
Your Quest
powerUp takes a *int and increments it. Call it with the address of level, then print level.
Expected output:
6
Hint
Pass &level to powerUp, i.e. powerUp(&level), then fmt.Println(level).