[Go] Pointer

var name string
	var namePointer *string // Pointer

	name = "Beyonce"
	namePointer = &name // Assign a Pointer

	fmt.Println("Name: ", name)
	fmt.Println("Name *: ", *namePointer) // Need to add * to get value

posted @ 2022-09-06 01:42  Zhentiw  阅读(15)  评论(0编辑  收藏  举报