package main import ( "fmt" ) func main() { num1 := 100 fmt.Printf ( "num1 type of% T, num1 value =% v,% v num1 address of \ n", num1, num1, & num1) // num1 type int, the value num1 = 100, num1 address 0xc000062080 num2 := new(int) * Num2 = 100 fmt.Printf ( "num2 type% T, the value num2 =% v,% v num2 address of \ n-num2 the pointer value =% v", num2, num2, &num2, *num2) // num2 Type * int, num2 address value = 0xc000062098, num2 of 0xc00008e020 // num2 The pointer value = 100 }
Go built-in functions
Guess you like
Origin www.cnblogs.com/yzg-14/p/12227376.html
Recommended
Ranking