MCPcopy Create free account
hub / github.com/mmcgrana/gobyexample / zeroptr

Function zeroptr

examples/pointers/pointers.go:24–26  ·  view source on GitHub ↗

`zeroptr` in contrast has an `*int` parameter, meaning that it takes an `int` pointer. The `*iptr` code in the function body then _dereferences_ the pointer from its memory address to the current value at that address. Assigning a value to a dereferenced pointer changes the value at the referenced a

(iptr *int)

Source from the content-addressed store, hash-verified

22// Assigning a value to a dereferenced pointer changes the
23// value at the referenced address.
24func zeroptr(iptr *int) {
25 *iptr = 0
26}
27
28func main() {
29 i := 1

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected