fix: pointers example

This commit is contained in:
Inanc Gumus
2019-08-26 17:57:53 +03:00
parent 7e82a94bae
commit 5e87b77956

View File

@ -48,8 +48,8 @@ func structs() {
func addRoomPtr(h *house) {
h.rooms++ // same: (*h).rooms++
fmt.Printf("addRoomPtr() : %p %+v\n", h, h)
fmt.Printf("&myHouse.name : %p\n", &myHouse.name)
fmt.Printf("&myHouse.rooms: %p\n", &myHouse.rooms)
fmt.Printf("&h.name : %p\n", &h.name)
fmt.Printf("&h.rooms : %p\n", &h.rooms)
}
func addRoom(h house) {