- #include<stdio.h>
- void jjcc(int m,int n,int *p1,int *p2,int *p3,int *p4){
- *p1=m+n;
- *p2=m-n;
- *p3=m*n;
- *p4=m/n;
- }
- int main(){
- int m=10;
- int n=2;
- int a;//jia
- int b;//jian
- int c;//cheng
- int d;//chu
- int *p1=&a;
- int *p2=&b;
- int *p3=&c;
- int *p4=&d;
- jjcc(m,n,p1,p2,p3,p4);
- printf("a=%d,b=%d,c=%d,d=%d\n",*p1,*p2,*p3,*p4);
- return 0;}
复制代码 指针地址使用小试 |
|