mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:43:26 +08:00
Move images (#704)
* refactor: merge image directories into one ```bash git mv -v images/* eBook/images/ sed -i -e 's;../images;images;g' eBook/*.md ``` * use correct chapter number for image names in 4.9 * use correct chapter number for image names in 7.2.4
This commit is contained in:
@@ -144,13 +144,13 @@ func main() {
|
||||
|
||||
所有像 int、float、bool 和 string 这些基本类型都属于值类型,使用这些类型的变量直接指向存在内存中的值:
|
||||
|
||||

|
||||

|
||||
|
||||
另外,像数组(第 7 章)和结构(第 10 章)这些复合类型也是值类型。
|
||||
|
||||
当使用等号 `=` 将一个变量的值赋值给另一个变量时,如:`j = i`,实际上是在内存中将 i 的值进行了拷贝:
|
||||
|
||||

|
||||

|
||||
|
||||
你可以通过 &i 来获取变量 i 的内存地址(第 4.9 节),例如:0xf840000040(每次的地址都可能不一样)。值类型的变量的值存储在栈中。
|
||||
|
||||
@@ -160,7 +160,7 @@ func main() {
|
||||
|
||||
一个引用类型的变量 r1 存储的是 r1 的值所在的内存地址(数字),或内存地址中第一个字所在的位置。
|
||||
|
||||

|
||||

|
||||
|
||||
这个内存地址被称之为指针(你可以从上图中很清晰地看到,第 4.9 节将会详细说明),这个指针实际上也被存在另外的某一个字中。
|
||||
|
||||
|
Reference in New Issue
Block a user