Google News
logo
Golang - Interview Questions
What is a pointer in Golang?
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.​
Advertisement