We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7b6ca commit 21ed859Copy full SHA for 21ed859
course/basic/advanced_type/pointer.md
@@ -10,7 +10,15 @@ outline: deep
10
11
**取地址**:通过 `&` 符号来获取某个变量所对应的内存地址,如 `&integer` 就是获取变量 `integer` 的内存地址。
12
13
-zig 的指针和 C 的指针略有不同,包含两种指针,一种单项(single-item)指针,一种是多项(many-item)指针,它们的解引用的方式也略有不同。
+与 C 不同,Zig 中的指针类型有多种,主要是对指向的元素做了区分,便于更好地使用。下图展示了它们指向元素的不同:
14
+
15
+
16
17
+:::info 🅿️ 提示
18
19
+上图中包含了切片(slice)类型,严格来说它不是指针,但其是由指针构成的(一般称为胖指针),而且在代码中用的更为普遍,因此列在一起便于读者比较。
20
21
+:::
22
23
:::warning 关于指针运算
24
course/picture/basic/pointer-representation.svg
0 commit comments