0 votes
in GoLang by
What is a pointer in Go?

1 Answer

0 votes
by

A pointer is used to hold the address of a variable.

For example:

   

var x = 5  

var p *int  

p = &x  

fmt.Printf("x = %d", *p)  

Here x can be accessed by *p.

Related questions

0 votes
asked Aug 19, 2022 in GoLang by john ganales
0 votes
asked Apr 27, 2023 in GoLang by Robin
0 votes
asked Aug 19, 2022 in GoLang by john ganales
...