1 Star 0 Fork 0

wukai/GoStudy

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pointer.go 370 Bytes
一键复制 编辑 原始数据 按行查看 历史
君町love 提交于 2019-01-15 12:04 +08:00 . Package change
package base
import (
"fmt"
)
/** go指针 */
func Pointer() {
var i1 = 5
//fmt.Printf("An integer: %d, it's location in memory: %p\n", i1, &i1)
var i1P *int // 定义一个指针参数,与c的指针类似
i1P = &i1
fmt.Printf("An integer: %d, it's location in memory: %p\n", i1, i1P)
fmt.Printf("The value at memory location %p is %d\n", i1P, *i1P)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/thinkerwolf/GoStudy.git
git@gitee.com:thinkerwolf/GoStudy.git
thinkerwolf
GoStudy
GoStudy
62820d0e2c88

搜索帮助