### 1.以int64型指针的解释方式向n赋值:
```go
func main() {
var n int64 = 5
var pn = &n
var pf = (*float64)(unsafe.Pointer(pn))
fmt.Println(reflect.TypeOf(n))
fmt.Println(reflect.TypeOf(pf))
fmt.Println(reflect.TypeOf(pn))
*pn = 100
fmt.Println(n)
fmt.Println(*pn)
fmt.Println(*pf)
}
```
#### output:
``` go
int64
*float64
*int64
100
100
4.94e-322
```
### 2.以float64型指针的解释方式向n赋值
```go
func main() {
var n int64 = 5
var pn = &n
var pf = (*float64)(unsafe.Pointer(pn))
fmt.Println(reflect.TypeOf(n))
fmt.Println(reflect.TypeOf(pf))
fmt.Println(reflect.TypeOf(pn))
*pf = 100
fmt.Println(n)
fmt.Println(*pn)
fmt.Println(*pf)
}
```
#### output:
```go
int64
*float64
*int64
4636737291354636288
4636737291354636288
100
```
有疑问加站长微信联系(非本文作者))