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)=p1+51=0x801000+ox5=0x801005
p2+5=p2+51=p2+5sizeof(unsigned long)=p1+54=0x810000+20=0x810000+0x14=0x810014
最后要转换成16进制