TAKE MY COURSES - CREATE YOUR OWN
https://www.greatercommons.com/
When should you use pointers in programming? What do pointers allow you to do? Pointers allow you to pass only an address, instead of all of the data. Pointers also allow you to MODIFY (mutate) the data stored at that address. So if you don't want to pass all of the data, or if you want to change the data stored at a memory address, then use a pointer.
Pointers allow you to share a value stored in some memory location. Use pointers when
you don’t want to pass around a lot of data
you want to change the data at a location
Everything in Go is pass by value. Drop any phrases and concepts you may have from other languages. Pass by reference, pass by copy - forget those phrases. “Pass by value.” That is the only phrase you need to know and remember. That is the only phrase you should use. Pass by value. Everything in Go is pass by value. In Go, what you see is what you get (wysiwyg). Look at what is happening. That is what you get.
code:
step 1 no pointer: https://play.golang.org/p/lxsWkhTaYv
step 2 pointer: https://play.golang.org/p/XuI19kjFmb
JOIN ME, CONNECT, & FOLLOW
https://twitter.com/todd_mcleod
https://plus.google.com/+ToddMcLeod
https://www.linkedin.com/in/tamcleod
https://www.facebook.com/tscottmcleod
https://www.instagram.com/tuddleymcleod
YOUTUBE PERSONAL
https://www.youtube.com/channel/UCJ8Y...
EQUIPMENT:
https://goo.gl/uNb5QJ
When should you use pointers in programming? What do pointers allow you to do? Pointers allow you to pass only an address, instead of all of the data. Pointers also allow you to MODIFY (mutate) the data stored at that address. So if you don't want to pass all of the data, or if you want to change the data stored at a memory address, then use a pointer.
Pointers allow you to share a value stored in some memory location. Use pointers when
you don’t want to pass around a lot of data
you want to change the data at a location
Everything in Go is pass by value. Drop any phrases and concepts you may have from other languages. Pass by reference, pass by copy - forget those phrases. “Pass by value.” That is the only phrase you need to know and remember. That is the only phrase you should use. Pass by value. Everything in Go is pass by value. In Go, what you see is what you get (wysiwyg). Look at what is happening. That is what you get.
code:
step 1 no pointer: https://play.golang.org/p/lxsWkhTaYv
step 2 pointer: https://play.golang.org/p/XuI19kjFmb
JOIN ME, CONNECT, & FOLLOW
https://twitter.com/todd_mcleod
https://plus.google.com/+ToddMcLeod
https://www.linkedin.com/in/tamcleod
https://www.facebook.com/tscottmcleod
https://www.instagram.com/tuddleymcleod
YOUTUBE PERSONAL
https://www.youtube.com/channel/UCJ8Y...
EQUIPMENT:
https://goo.gl/uNb5QJ
When To Use Pointers in Programming - Go Lang Pointers programming logic and design pdf | |
122 Likes | 122 Dislikes |
6,074 views views | 21.3K followers |
Education | Upload TimePublished on 16 Apr 2018 |
Không có nhận xét nào:
Đăng nhận xét