各种++
int main(){
void test(int *p);
int a[3]={1,2,3};
printf("%p
",a);
printf("%p
",&a[0]);
printf("%lu
",sizeof(a));
printf("%lu
",sizeof(a[0]));
test(a);
}
void test(int *p){
printf("a address =%p
",p);
printf("*p a[0] =%p
",*p);
printf("*(p+1) a[1]=%p
",*(p+1));
printf("*(p++) =%p
",*(p++));
printf("*(++p) =%p
",*(++p));
printf("++(*p) =%p
",++(*p));
printf("p+1 =%p
",p+1);
printf("++p =%p
",++p);
printf("sizeof(p) =%lu
",sizeof(p));
}
通过指针可以在形参中改变主函数中实参的值
通过指针可以返回多个值
随着每次的自增或自减 p在变化