An example Analysis of Go language pointer
This article mainly explains "Go language pointer example analysis", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "Go language pointer example analysis" it!
As we all know, a variable is an easy-to-use placeholder for referencing the computer's memory address.
The Go language takes the address character &, which is used in front of a variable and returns the memory address of the corresponding variable.
The following example demonstrates the in-memory address of a variable:
Example
Package main
Import "fmt"
Func main () {
Var an int = 10
Fmt.Printf ("address of variable:% x\ n", & a)
}
The output result of executing the above code is:
Variable address: 20818a220 so far, I believe we have a deeper understanding of the "Go language pointer instance analysis", you might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!