c语言指针
#include<stdio.h>void main()
{
void wa(int *p1,int *p2);
int a,b;
int *pa,*pb;
printf("please input two numbers:");
scanf("%d%d",&a,&b);
pa=&a;
pb=&b;
if(a<b) wa(*pa,*pb);
printf("max is %d,min is %d\n",*pa,*pb);
}
void wa(int *p1,int *p2)
{
int *temp;
temp=p1;
p1=p2;
p2=temp;
}
为什么不行?