S
S
Sm4llDev2020-05-29 20:04:43
go
Sm4llDev, 2020-05-29 20:04:43

Pointers in Go?

For a very long time I tried to delve into pointers in Go and in general in general, but did not understand the principle of their work. Can you explain with simple examples or metaphors?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2020-05-29
@Sm4llDev

Your grandmother knows where Aunt Galya lives. In fact, your grandmother has a pointer to Aunt Galya in her RAM. Dereference pointer to Aunt Galya = visit her at her address.
You know where your grandmother lives. And grandmother - where is Aunt Galya. You have a pointer to your grandmother. Double dereferencing = go to your grandmother and ask her for the address of Aunt Galya, and then come to visit her.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question