C/C++ 指针地址变化与类型-真题
unsigned char *p1; unsigned long *p2; p1=(unsigned char *)0x801000; p2=(unsigned long *)0x810000; 问: p1+5=? p2+5=?p1+5=801000 p2+5=810014解析:char每次移动1个字节;short移动2个字节 ;int , long ,float移动4个字节 ;double移动8个字节;p1+5=p1+51=p1+5sizeof(unsigned char)=
原创
2021-05-26 21:09:44 ·
712 阅读 ·
0 评论