package main
import "fmt"
func main() {
a := 2
b := a
a = 12
fmt.Println(b)
}
package main
import "fmt"
func main() {
a := 2
b := a
fmt.Println(&b, &a)
}
package main
import "fmt"
func main() {
a := 2
b := &a
fmt.Println(b, &a)
}
package main
import "fmt"
func main() {
a := 2
b := &a
a = 50
fmt.Println(*b)
}
강의 출처 : 노마드코더(https://nomadcoders.co)
[Nomad Coin] Tour of Go - #3.7 Structs with Pointers (0) | 2022.07.11 |
---|---|
[Nomad Coin] Tour of Go - #3.6 Structs (0) | 2022.07.11 |
[Nomad Coin] Tour of Go - #3.4 Slices and Arrays (0) | 2022.07.10 |
[Nomad Coin] Tour of Go - #3.3 fmt (0) | 2022.07.10 |
[Nomad Coin] Tour of Go - #3.2 functions (0) | 2022.07.10 |
댓글 영역