// Pointers hold the memory address of a type.
// *T represents a pointer to T. zero value is nil.
package main
import "fmt"
func main() {
var i int = 10
// '&' is address of i, assign the address
// of i to p
var p *int = &i
// '*' used to dereference/indirect the pointer
fmt.Println(*p)
*p = 100
fmt.Println(i)
}
To embed this program on your website, copy the following code and paste it into your website's HTML: