V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  RDF  ›  全部回复第 2 页 / 共 2 页
回复总数  28
1  2  
@RDF 复合
@tghgffdgd 还在啃 Compound Types 符合类型的基础, 这部分的基础有点难啃, 快了。
@tghgffdgd 哦哦
上文是:字符串首字符的地址,读地址,并显示字符,那(int * )强制转换出的,就是 H 字符所在实际内存地址,

......依旧小晕...
short tell[10];
tell displays &tell[0]
&tell displays address of whole array
地址数字相同,但是含义不一样。
&tell[0], is the address of a 2-byte block of memory
&tell is the address of a 20-byte block of memory

So

tell + 1 adds 2 to the address value
&tell + 1 adds 20 to the address value

......估计还会忘...
@tghgffdgd 嗷嗷,谢谢~
@tghgffdgd 似乎在部分实现中,其开始的地址显示相同,而进行‘+1 ’的操作后,可以看出内存增量的不同, 但 cout 形式的话,不会判断。
@tghgffdgd 不会判断打印出的是字符串第一个字符的地址 还是字符串开始的地址。
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2520 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 02:28 · PVG 10:28 · LAX 19:28 · JFK 22:28
Developed with CodeLauncher
♥ Do have faith in what you're doing.