Skip to content

Instantly share code, notes, and snippets.

@hiepndd
Last active May 25, 2019 10:44
Show Gist options
  • Select an option

  • Save hiepndd/49be60cfae3397ffb8cddc6e48fccd5e to your computer and use it in GitHub Desktop.

Select an option

Save hiepndd/49be60cfae3397ffb8cddc6e48fccd5e to your computer and use it in GitHub Desktop.
package main
import "fmt"
func double(x *int) {
*x = *x + *x
}
func main() {
var a = 3
double(&a)
fmt.Println(a) //6
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment