Standard library / reflect

reflect.Value.Pointer()

Returns a uintptr representation for supported kinds. It does not keep storage alive and is not a general identity for functions; do not convert the saved integer back to a pointer. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) Pointer() uintptr

Return Value

uintptr

Returns a uintptr representation for supported kinds.

Working Example

Example Snippetgo
package main
import (  "fmt"  "reflect")
func main() { var p *int; fmt.Println(reflect.ValueOf(p).Pointer() == 0) }
Go Reference