指针
int a={1,2,3,4};int *ptr1=(int *)(&a+1);
int *ptr2=(int *)((int)a+1);
int *ptr2=(int *)((int)a+1)他的这个把a的首元素地址转化成int 是指的什么? 本帖最后由 jhq999 于 2022-10-16 07:32 编辑
在a地址上右移了一个字节
*ptr2=0x02000000
int *ptr2=(int *)((int)a+1)他的这个把a的首元素地址转化成int 是指的什么?(int *)((int)a+1)是让ptr2指向a的第二个字节,此时打印的内容就是ptr2所指向的往后4个字节的内容了,也就是a{0}的后三个字节和a的第一个字节
具体你可以看这个说的很清楚
https://blog.csdn.net/qq_43295866/article/details/97016939 weibo.COM/a/hot/7628785906653185_1.html?bia/B82
weibo.COM/a/hot/7628785906653185_1.html?dt=Bg
weibo.COM/a/hot/7628785906653185_1.html?5=FXe
weibo.COM/a/hot/7628785910323201_1.html?xzh/lY9
weibo.COM/a/hot/7628785910323201_1.html?gk=lm
weibo.COM/a/hot/7628785910323201_1.html?0=ggY
weibo.COM/a/hot/7628785914484737_1.html?FqM/FPk
weibo.COM/a/hot/7628785914484737_1.html?TW=pm
weibo.COM/a/hot/7628785914484737_1.html?1=JQl
weibo.COM/a/hot/7628785914550274_1.html?kTa/sF0
weibo.COM/a/hot/7628785914550274_1.html?kY=RC
weibo.COM/a/hot/7628785914550274_1.html?6=iKz
weibo.COM/a/hot/7628785915598849_1.html?daA/NOO
weibo.COM/a/hot/7628785915598849_1.html?LX=lD
weibo.COM/a/hot/7628785915598849_1.html?0=XfL
weibo.COM/a/hot/7628785917696004_1.html?huT/1Ip
weibo.COM/a/hot/7628785917696004_1.html?eG=Kj
weibo.COM/a/hot/7628785917696004_1.html?6=hrd
weibo.COM/a/hot/7628785918154753_1.html?waZ/HOc
weibo.COM/a/hot/7628785918154753_1.html?Io=Tm
weibo.COM/a/hot/7628785918154753_1.html?4=nuE
weibo.COM/a/hot/7628785922414593_1.html?qgA/au4
weibo.COM/a/hot/7628785922414593_1.html?dB=kr
weibo.COM/a/hot/7628785922414593_1.html?6=LnS
weibo.COM/a/hot/7628785922381825_1.html?eVB/f96
weibo.COM/a/hot/7628785922381825_1.html?Zs=sG
weibo.COM/a/hot/7628785922381825_1.html?2=KuJ
weibo.COM/a/hot/7628785923430404_1.html?HIQ/xvs
weibo.COM/a/hot/7628785923430404_1.html?vp=jO
weibo.COM/a/hot/7628785923430404_1.html?1=IoB
weibo.COM/a/hot/7628785923463169_1.html?PJZ/9Nr
weibo.COM/a/hot/7628785923463169_1.html?Bt=VH
weibo.COM/a/hot/7628785923463169_1.html?5=Vjw
weibo.COM/a/hot/7628785926084609_1.html?apE/pEY
weibo.COM/a/hot/7628785926084609_1.html?zH=rc
weibo.COM/a/hot/7628785926084609_1.html?7=rrC
weibo.COM/a/hot/7628785927591938_1.html?qEj/RvO
weibo.COM/a/hot/7628785927591938_1.html?PH=MO
weibo.COM/a/hot/7628785927591938_1.html?9=roL
weibo.COM/a/hot/7628785927657474_1.html?WMH/pGd
weibo.COM/a/hot/7628785927657474_1.html?dG=VA
weibo.COM/a/hot/7628785927657474_1.html?7=bYb
weibo.COM/a/hot/7628785928640515_1.html?KiH/FJT
weibo.COM/a/hot/7628785928640515_1.html?iN=ay
weibo.COM/a/hot/7628785928640515_1.html?7=YZq
weibo.COM/a/hot/7628785932376066_1.html?PZq/bLs
weibo.COM/a/hot/7628785932376066_1.html?hP=dR
weibo.COM/a/hot/7628785932376066_1.html?6=MSN
weibo.COM/a/hot/7628785936013313_1.html?QIw/Fwq
weibo.COM/a/hot/7628785936013313_1.html?Lo=Qb
weibo.COM/a/hot/7628785936013313_1.html?3=SKw
weibo.COM/a/hot/7628785936046083_1.html?ccG/Uyy
weibo.COM/a/hot/7628785936046083_1.html?JB=nY
weibo.COM/a/hot/7628785936046083_1.html?3=Pjh
weibo.COM/a/hot/7628785939159042_1.html?WVS/qNR
weibo.COM/a/hot/7628785939159042_1.html?sZ=Lq
weibo.COM/a/hot/7628785939159042_1.html?2=ihV
weibo.COM/a/hot/7628785939126276_1.html?uRd/cSg
weibo.COM/a/hot/7628785939126276_1.html?Ly=Bd
weibo.COM/a/hot/7628785939126276_1.html?2=ldd
weibo.COM/a/hot/7628785939683329_1.html?Vad/s2P
weibo.COM/a/hot/7628785939683329_1.html?Yl=Rq
weibo.COM/a/hot/7628785939683329_1.html?6=UoP
weibo.COM/a/hot/7628785940240385_1.html?zXQ/uH1
weibo.COM/a/hot/7628785940240385_1.html?ij=Kz
weibo.COM/a/hot/7628785940240385_1.html?8=qZo
weibo.COM/a/hot/7628785940731905_1.html?KTr/j2g
weibo.COM/a/hot/7628785940731905_1.html?wh=UO
weibo.COM/a/hot/7628785940731905_1.html?0=NWh
weibo.COM/a/hot/7628785943353345_1.html?KQT/EcP
weibo.COM/a/hot/7628785943353345_1.html?JM=CQ
weibo.COM/a/hot/7628785943353345_1.html?7=eQc
weibo.COM/a/hot/7628785943353346_1.html?SLY/t0E
weibo.COM/a/hot/7628785943353346_1.html?PM=HE
weibo.COM/a/hot/7628785943353346_1.html?8=nPb
weibo.COM/a/hot/7628785943386113_1.html?vXC/aVL
weibo.COM/a/hot/7628785943386113_1.html?Pu=An
weibo.COM/a/hot/7628785943386113_1.html?7=xBF
weibo.COM/a/hot/7628785943386114_1.html?WWU/q3U
weibo.COM/a/hot/7628785943386114_1.html?gK=gE
weibo.COM/a/hot/7628785943386114_1.html?2=NDJ
weibo.COM/a/hot/7628785943910403_1.html?kuv/5dD
weibo.COM/a/hot/7628785943910403_1.html?gg=KB
weibo.COM/a/hot/7628785943910403_1.html?8=dpO
weibo.COM/a/hot/7628785943877634_1.html?KYo/UVV
weibo.COM/a/hot/7628785943877634_1.html?WB=wG
weibo.COM/a/hot/7628785943877634_1.html?7=IGR
weibo.COM/a/hot/7628785947580418_1.html?Uiu/O5S
weibo.COM/a/hot/7628785947580418_1.html?LH=re
weibo.COM/a/hot/7628785947580418_1.html?1=wQj
weibo.COM/a/hot/7628785949677569_1.html?BqR/T7u
weibo.COM/a/hot/7628785949677569_1.html?Le=dg
weibo.COM/a/hot/7628785949677569_1.html?3=nVZ
weibo.COM/a/hot/7628785949612035_1.html?cNZ/HLz
weibo.COM/a/hot/7628785949612035_1.html?Qx=gm
weibo.COM/a/hot/7628785949612035_1.html?6=dKZ
weibo.COM/a/hot/7628785950693379_1.html?hoc/CTW
weibo.COM/a/hot/7628785950693379_1.html?dj=bi
weibo.COM/a/hot/7628785950693379_1.html?5=CgH
weibo.COM/a/hot/7628785950660609_1.html?kyA/eSZ
weibo.COM/a/hot/7628785950660609_1.html?lf=aR
weibo.COM/a/hot/7628785950660609_1.html?1=ilF
weibo.COM/a/hot/7628785954887681_1.html?Ciu/ySw
weibo.COM/a/hot/7628785954887681_1.html?OI=kC
weibo.COM/a/hot/7628785954887681_1.html?7=xQl
weibo.COM/a/hot/7628785954854913_1.html?mun/7Hf
weibo.COM/a/hot/7628785954854913_1.html?cJ=yO
weibo.COM/a/hot/7628785954854913_1.html?4=Bbe
weibo.COM/a/hot/7628785954854914_1.html?TLO/z6K
weibo.COM/a/hot/7628785954854914_1.html?VU=wQ
weibo.COM/a/hot/7628785954854914_1.html?7=fYr
weibo.COM/a/hot/7628785955444738_1.html?pNz/Kv5
weibo.COM/a/hot/7628785955444738_1.html?Zz=ap
weibo.COM/a/hot/7628785955444738_1.html?5=Gnk
weibo.COM/a/hot/7628785955936258_1.html?TzN/tgH
weibo.COM/a/hot/7628785955936258_1.html?FK=Ma
weibo.COM/a/hot/7628785955936258_1.html?4=Boy
weibo.COM/a/hot/7628785956952066_1.html?RUT/MGa
weibo.COM/a/hot/7628785956952066_1.html?pC=nS
weibo.COM/a/hot/7628785956952066_1.html?4=aPP
weibo.COM/a/hot/7628785956952067_1.html?aJa/MNu
weibo.COM/a/hot/7628785956952067_1.html?iv=xh
weibo.COM/a/hot/7628785956952067_1.html?2=TJf
weibo.COM/a/hot/7628785958590467_1.html?xWY/PtN
weibo.COM/a/hot/7628785958590467_1.html?jp=AW
weibo.COM/a/hot/7628785958590467_1.html?8=jLO
weibo.COM/a/hot/7628785961736194_1.html?Omz/2mn
weibo.COM/a/hot/7628785961736194_1.html?Mt=VZ
weibo.COM/a/hot/7628785961736194_1.html?0=hSY
weibo.COM/a/hot/7628785964816385_1.html?EiF/Yzt
weibo.COM/a/hot/7628785964816385_1.html?Kt=eH
weibo.COM/a/hot/7628785964816385_1.html?8=tvw
weibo.COM/a/hot/7628785965340673_1.html?aMz/aE2
weibo.COM/a/hot/7628785965340673_1.html?Rg=AD
weibo.COM/a/hot/7628785965340673_1.html?1=HBt
weibo.COM/a/hot/7628785965864961_1.html?Myb/x7y
weibo.COM/a/hot/7628785965864961_1.html?Ha=ro
weibo.COM/a/hot/7628785965864961_1.html?3=URg
weibo.COM/a/hot/7628785966389249_1.html?tUG/HOc
weibo.COM/a/hot/7628785966389249_1.html?fm=qn
weibo.COM/a/hot/7628785966389249_1.html?2=pPX
weibo.COM/a/hot/7628785968027649_1.html?xmR/kEB
weibo.COM/a/hot/7628785968027649_1.html?tk=WB
weibo.COM/a/hot/7628785968027649_1.html?4=hSg
weibo.COM/a/hot/7628785968551937_1.html?SrL/gkN
weibo.COM/a/hot/7628785968551937_1.html?VR=Aq
weibo.COM/a/hot/7628785968551937_1.html?8=GhT
weibo.COM/a/hot/7628785969010689_1.html?Qyx/cGa
weibo.COM/a/hot/7628785969010689_1.html?xK=QH
weibo.COM/a/hot/7628785969010689_1.html?9=bqJ
weibo.COM/a/hot/7628785969567745_1.html?pLP/rVm
weibo.COM/a/hot/7628785969567745_1.html?Vw=ju
weibo.COM/a/hot/7628785969567745_1.html?3=Sha
weibo.COM/a/hot/7628785976875009_1.html?ZzO/78f
weibo.COM/a/hot/7628785976875009_1.html?Gv=MK
weibo.COM/a/hot/7628785976875009_1.html?4=paf
weibo.COM/a/hot/7628785979496449_1.html?WWv/lSp
weibo.COM/a/hot/7628785979496449_1.html?Ob=Bp
weibo.COM/a/hot/7628785979496449_1.html?6=RCu
weibo.COM/a/hot/7628785987426305_1.html?enx/P0A
weibo.COM/a/hot/7628785987426305_1.html?hf=nz
weibo.COM/a/hot/7628785987426305_1.html?0=WjF
weibo.COM/a/hot/7628785988966401_1.html?rYE/Jdo
weibo.COM/a/hot/7628785988966401_1.html?Nz=Qe
weibo.COM/a/hot/7628785988966401_1.html?1=QGk
weibo.COM/a/hot/7628785992079363_1.html?qlD/oZZ
weibo.COM/a/hot/7628785992079363_1.html?Pb=IC
weibo.COM/a/hot/7628785992079363_1.html?4=ika
weibo.COM/a/hot/7628785996339201_1.html?cfM/GNb
weibo.COM/a/hot/7628785996339201_1.html?Nq=Kb
weibo.COM/a/hot/7628785996339201_1.html?0=XFa
weibo.COM/a/hot/7628785996797953_1.html?ufN/fIZ
weibo.COM/a/hot/7628785996797953_1.html?Rc=RE
weibo.COM/a/hot/7628785996797953_1.html?5=OwJ
weibo.COM/a/hot/7628786000992257_1.html?YYC/Lc9
weibo.COM/a/hot/7628786000992257_1.html?cK=nl
weibo.COM/a/hot/7628786000992257_1.html?5=GrA
weibo.COM/a/hot/7628786001025025_1.html?XJv/BLC
weibo.COM/a/hot/7628786001025025_1.html?Uw=kW
weibo.COM/a/hot/7628786001025025_1.html?6=irt
页:
[1]