package main
import (
"fmt"
"runtime"
)
func main() {
var p *int
{
x := 42
p = &x // p points to x
fmt.Println(*p) // Prints 42
}
// Force garbage collection (for testing)
runtime.GC()
// Dereferencing p here should cause an error (since x is out of scope)
fmt.Println(*p) // This does NOT throw any error
}