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 b4d8a0f commit 757823aCopy full SHA for 757823a
slice.md
@@ -15,6 +15,29 @@ type slice struct {
15
16
slice 的底层结构定义非常直观,指向底层数组的指针,当前长度 len 和当前slice 的 cap。
17
18
+```
19
+
20
+ []int{1,3,4,5}
21
22
+ struct {
23
+ array unsafe.Pointer --------------+
24
+ len int |
25
+ cap int |
26
+ } |
27
+ |
28
+ v
29
30
+ +------|-------|------|------+-----+
31
+ | | 1 | 3 | 4 | 5 |
32
+ | | | | | |
33
34
+ [5]int
35
36
37
38
39
40
41
42
43
> Written with [StackEdit](https://stackedit.io/).
0 commit comments