diff --git a/docs/notes/01_c-basic/06_xdx/assets/5.png b/docs/notes/01_c-basic/06_xdx/assets/5.png deleted file mode 100644 index 9c383d6..0000000 Binary files a/docs/notes/01_c-basic/06_xdx/assets/5.png and /dev/null differ diff --git a/docs/notes/01_c-basic/06_xdx/assets/5.svg b/docs/notes/01_c-basic/06_xdx/assets/5.svg new file mode 100644 index 0000000..292df67 --- /dev/null +++ b/docs/notes/01_c-basic/06_xdx/assets/5.svg @@ -0,0 +1,4 @@ + + + +
程序
内存条
00000000
00000000
00000000
00001010
内存地址
存储单元
0x7ffc3e5cc514
0x7ffc3e5cc515
0x7ffc3e5cc516
0x7ffc3e5cc517
num(变量)
内存地址:0x7ffc3e5cc514
10 的二进制
\ No newline at end of file diff --git a/docs/notes/01_c-basic/06_xdx/assets/6.svg b/docs/notes/01_c-basic/06_xdx/assets/6.svg index 9da4367..f0230d0 100644 --- a/docs/notes/01_c-basic/06_xdx/assets/6.svg +++ b/docs/notes/01_c-basic/06_xdx/assets/6.svg @@ -1,4 +1,4 @@ -
内存条
00000000
num(变量)
内存地址:0x0012FF44
程序
内存地址:0x0012FF44
00000000
00000000
00001010
10 的二进制
\ No newline at end of file +
程序
内存条
00000000
00000000
00000000
00001010
内存地址
存储单元
0x7ffc3e5cc514
0x7ffc3e5cc515
0x7ffc3e5cc516
0x7ffc3e5cc517
num(变量)
内存地址:0x7ffc3e5cc514
10 的二进制
p(变量)
内存地址:0x7ffd7b5bdcb0
00000000
00000000
01111111
11111100
00111110
01011100
11000101
00010100
0x7ffd7b5bdcb0
0x7ffd7b5bdcb1
0x7ffd7b5bdcb2
0x7ffd7b5bdcb3
0x7ffd7b5bdcb4
0x7ffd7b5bdcb5
0x7ffd7b5bdcb6
0x7ffd7b5bdcb7
内存地址
存储单元
0x7ffc3e5cc514 的二进制
\ No newline at end of file diff --git a/docs/notes/01_c-basic/06_xdx/assets/7.svg b/docs/notes/01_c-basic/06_xdx/assets/7.svg deleted file mode 100644 index 9079da9..0000000 --- a/docs/notes/01_c-basic/06_xdx/assets/7.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
内存条
00000000
num(变量)
内存地址:0x0012FF44
程序
内存地址:0x0012FF44
00000000
00000000
00001010
10 的二进制
p(变量)
内存地址:0x0022FF44
00000000
00010010
11111111
01000100
内存地址:0x0022FF44
0x0012FF44 的二进制
00000000
00000000
00000000
00000000
\ No newline at end of file diff --git a/docs/notes/01_c-basic/06_xdx/index.md b/docs/notes/01_c-basic/06_xdx/index.md index b37aa41..3da2485 100644 --- a/docs/notes/01_c-basic/06_xdx/index.md +++ b/docs/notes/01_c-basic/06_xdx/index.md @@ -268,13 +268,9 @@ int main() { } ``` -* 其在内存中,就是这样的,如下所示: - -![](./assets/5.png) - * 虽然,之前我们在程序中都是通过`变量名(普通变量)`直接操作内存中的存储单元;但是,编译器底层还是会通过`内存地址`来找到所需要的存储单元,如下所示: -![](./assets/6.svg) +![](./assets/5.svg) > [!NOTE] > @@ -289,7 +285,7 @@ int main() { * `普通变量`所对应的内存空间`存储`的是`普通的值`,如:整数、小数、字符等;`指针变量`所对应的内存空间`存储`的是另外一个变量的`地址(指针)`,如下所示: -![](./assets/7.svg) +![](./assets/6.svg) > [!NOTE] > @@ -300,6 +296,10 @@ int main() { > > 下文中提及的`指针`都是`指针变量`,不再阐述!!! +> [!WARNING] +> +> 如果你观察仔细的话,你可能会发现`指针变量`和`普通变量`在内存中占据的存储空间是不一样的,那么到底是什么原因造成这样的结果? + ## 3.3 指针变量的定义