![](https://i-blog.csdnimg.cn/blog_migrate/b69b22e3a57f67843225bb3ee95fbebb.png)
c语言两个指针交换指向
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int *a,*b,*temp;
cout<<“Enter value of a and b:”;
cin>>*a>>*b;
temp=a;
a=b;
b=temp;
cout<<“nAfter swapingna=”<<*a<<“nb=”<<*b;
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int *a,*b,*temp;
cout<<“Enter value of a and b:”;
cin>>*a>>*b;
temp=a;
a=b;
b=temp;
cout<<“n After swaping na=”<<*a<<“nb=”<<*b;
getch();
}
翻译自: https://www.thecrazyprogrammer.com/2013/05/c-program-to-swap-two-numbers-using_30.html
c语言两个指针交换指向