go20/day04/pointer/README.md
yumaojun03 11aaa2d03a ```
docs(day04): 更新README目录结构并添加内存管理图表

- 在README.md中更新目录链接,将原有的列表格式改为链接格式
- 添加Go语言结构体、指针和反射的相关文档链接
- 修改drawio图表文件,调整坐标参数和页面布局
- 增加堆栈内存管理的可视化图表,包含函数调用和变量分配示例
- 添加代码示例展示Go语言中的变量提升机制
```
2026-02-01 17:37:44 +08:00

16 lines
302 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 指针
## 陷阱 2指针指向栈变量的地址逃逸
Go 编译器会自动处理,通常无需担心:
```go
func getPtr() *int {
v := 10
return &v // v 虽然是局部变量,但 Go 会自动提升到堆
}
```
![alt text](image.png)
## 作业: 实现链表节点和基本操作