阅读背景:

使用增量(*p++ = x)来延迟指针会改变*p到p的值。

来源:互联网 
#include <stdio.h>
int main(){
int i=1;
int * p = &i;
*(p++)=4;

printf("%p\n", p);   //0x7ffc000f47c8  
printf("%u\n", p);   //956816552 (which is 0x7ffc000f47c8 as unsigned integer) 
printf("%u\n", *p);  //956816552 (I would expect *p to be the value of whatever is in 0x7ffc000f47c8, and not the unsigned value of the pointer p (956816552))

return 0;
}
#include <stdio.h>
int main(){
int i=1;
int * p



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: