多级指针类型

 

指针 - Go语言101(通俗版Go白皮书) https://gfw.go101.org/article/pointer.html

*int  // 一个基类型为int的非定义指针类型。
**int // 一个多级非定义指针类型,它的基类型为*int。

type Ptr *int // Ptr是一个定义的指针类型,它的基类型为int。
type PP *Ptr  // PP是一个定义的多级指针类型,它的基类型为Ptr。

 

*int  // A non-defined pointer type whose base type is int.
**int // A non-defined pointer type whose base type is *int.

// Ptr is a defined pointer type whose base type is int.
type Ptr *int
// PP is a defined pointer type whose base type is Ptr.
type PP *Ptr

 

Pointers in Go - Go 101: an online Go programming book + knowledge base https://go101.org/article/pointer.html

 

posted @ 2021-02-14 23:43  papering  阅读(104)  评论(0编辑  收藏  举报