2019独角兽企业重金招聘Python工程师标准>>>
{
int a =5,b=3;
int *p;
p = &a;
b=*P+5;
printf("%d\n", b);
*p = 4;
printf("%d,%d\n",a,*p);
}
输出结果:10 4 4
之前在学校的时候就没怎么搞懂, 现在再重新学习一下,发现竟然很容易。
#include <stdio.h>
void main(){
int a,b,c;
int *pa,*pb,*pc;
pa = &a,pv=&b,pc=&c;
scanf("%d%d",pa,pb);
printf("a=%d,b=%d\n",*pa,*pb);
c=a+b; printf("c=%d\n",*pc);
*pc=a+*pb; printf("c=%d\n",c);
c=*pa**pb; printf("c=%d\n",c);
c=++*pa+(*pb)++; printf("c=%d\n",c);
c=(*pa)+++*pb; printf("c=%d\n",c);
printf("a=%d,b=%d\n",a,b);
}
结果: 2 3
a=2,b=3
c=5
c=5
c=6
c=6
c=7
a=4,b=4