From 98c377bcd4a8bd09573dc61c42759f2918d0f340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=A4=A7=E4=BB=99?= <1900919313@qq.com> Date: Sun, 11 Aug 2024 10:22:58 +0800 Subject: [PATCH] c --- docs/notes/01_c-basic/06_xdx/assets/5.png | Bin 12508 -> 0 bytes docs/notes/01_c-basic/06_xdx/assets/5.svg | 4 ++++ docs/notes/01_c-basic/06_xdx/assets/6.svg | 2 +- docs/notes/01_c-basic/06_xdx/assets/7.svg | 4 ---- docs/notes/01_c-basic/06_xdx/index.md | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 docs/notes/01_c-basic/06_xdx/assets/5.png create mode 100644 docs/notes/01_c-basic/06_xdx/assets/5.svg delete mode 100644 docs/notes/01_c-basic/06_xdx/assets/7.svg 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 9c383d663a339b0347261e74fe76bd8e9e162b01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12508 zcmeHucT|)4x^=MNfCD&U89`(e5g`J~08zRqARr*2Nf(t~qI3vN1+0j4rS~41AxMp) zfCTA~03ivA)DVi000|-Y4LWmX&YU^t%st=tt$Ww{SWExNBCo$UdG~(yv-kGl6@4up zZUJr(2*jg(=^_*a;(!5vSl@91uROP~G6R8r0%>17Z|t8+A%waKI){*!qG7lZU8!1B zEiqcZs|e#FimeAptKG5TDV}N^m()2_I3{u0bs;fwjJxfsIZ|o-*mt}`k#~;zAC!80 z>hmqv!pH)Gbx&c%9&U34?2(T|GgVbDi#U?yEkSN=oUz_3>%2_PW@K%?$+`^P>v%FI z`v{%6?YpbXAC?!hz7JhnV|;&KOCAD&>;#?0wACqdfYiv}!9b_?eB=Rf9&6xutriXe z{rF&!6SVyYBIw#r&4QrsFZyo}yYr{NH2ss7Ggwlrr`CRAJhAVMK4*GBw;z0)zwbF` z-FE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1@bTJKf&Hq@8OpIoBgaG`ToyAo33 zKIht7yB=1}9q5A+VgMm+eAUF9dqZ_Qe}&yc)Y{^g3L9%-+(^#I2o0!xloQmH{(0A8 z*DaQLCoF9_J>TX?uOgl{na6q=en?+yChRXOJZugsuY=uXs!BkTi5hg zn=qZ*<6!~>HSBEE)7Ej&XO&ik-Ih+=qHsO^MN=HT6>fn?IX}FR^;M6XNs9Ite4e~6 zF(n4Bp0T>@d4PEji8ychE#YKuyM?85Sbhm3D`@qn-gFc|)KkmoXUwC27Q~|Wez`aS zTY%qn(!O-z2j@YC`0tkB6n6*gs(WLwpZ*Abz^zcjXql7d_G|wl&~K_#7W-}0{l_YO zxY^|NiLA*e;_|CPMMQjXPjb(*V-n7dR$f2=3bjVm{n~s2)>7cvsAN(DZ|MRI*fPE< z=NokOUfX@Sv+TZA0obe{lc_Flty6lE;VTylK9BeyXbE-`6Z&PZ1^8x!3k!KY6aox4 zpgy5|cyzBl|KS7G!b1T-sExAtG7SXeT8?-X$+^;Bd1ny*PkE;V!J{rlsTQ>#49?77 z7JNVzOiU}kBRo7hIyyHrt^65_@LQ+(9}Wb>ocEtQg@4v}6^`cnC#(ZhLjJ1D{=b2B z{$HxAwm(-_3OKBI>9=|n&fCN_+T{XJvxp`QyvDjPwyGAc5HVT*4G6U>$GP!X5xZs8 zDyUUjHr7Tqn`PHCr%PAg0$s6n2sfeZiIHl?!^Gwth`&)@0uVdy*W-KN*+L^guE5_2 zp6WXrXuiIdD@(@kCZ!|}<9N1fSeXij zh_!2X)M3xEBgDKqkxC=3qKe|G+?Uqku@t9TC1Iu)c$wua^`Ov8f?LiER|dMVY)wcDCH|n(LB?EgoE4lHy)f$ z{=^Q7pp#o@ + + +
程序
内存条
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 指针变量的定义