// Chapter 27 example: a pointer holds the location of a variable. // Run with: go run exercises/27/01-pointer-basics.go package main import "fmt" func addBonus(n *int, bonus int) { *n = *n + bonus } func main() { score := 10 p := &score fmt.Println(*p) // 10 *p = 20 fmt.Println(score) // 20 addBonus(&score, 5) fmt.Println(score) // 25 }